Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
885e010d
Commit
885e010d
authored
7 years ago
by
Amaury Johnen
Browse files
Options
Downloads
Patches
Plain Diff
higher order elements are not needed to draw the high-order pview
parent
309b9523
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Plugin/AnalyseCurvedMesh.cpp
+78
-61
78 additions, 61 deletions
Plugin/AnalyseCurvedMesh.cpp
Plugin/AnalyseCurvedMesh.h
+1
-1
1 addition, 1 deletion
Plugin/AnalyseCurvedMesh.h
with
79 additions
and
62 deletions
Plugin/AnalyseCurvedMesh.cpp
+
78
−
61
View file @
885e010d
...
@@ -116,9 +116,9 @@ PView* GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
...
@@ -116,9 +116,9 @@ PView* GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
_numElementToScan
=
static_cast
<
int
>
(
CurvedMeshOptions_Number
[
7
].
def
);
_numElementToScan
=
static_cast
<
int
>
(
CurvedMeshOptions_Number
[
7
].
def
);
_viewOrder
=
10
;
_viewOrder
=
10
;
_elementToScan
=
NULL
;
_elementToScan
=
NULL
;
_hoElement
=
NULL
;
//
_hoElement = NULL;
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
_allElem
[
type
].
clear
();
//
_allElem[type].clear();
_dataPViewJacAllElements
[
type
].
clear
();
_dataPViewJacAllElements
[
type
].
clear
();
}
}
...
@@ -544,20 +544,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
...
@@ -544,20 +544,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
_entity
=
entity
;
_entity
=
entity
;
_elementToScan
=
el
;
_elementToScan
=
el
;
fullMatrix
<
double
>
points
=
//
fullMatrix<double> points =
_elementToScan
->
getFunctionSpace
(
_viewOrder
)
->
points
;
//
_elementToScan->getFunctionSpace(_viewOrder)->points;
int
tag
=
ElementType
::
getTag
(
_elementToScan
->
getType
(),
_viewOrder
);
//
int tag = ElementType::getTag(_elementToScan->getType(), _viewOrder);
std
::
vector
<
MVertex
*>
v
;
//
std::vector<MVertex *> v;
for
(
int
k
=
0
;
k
<
points
.
size1
();
k
++
)
{
//
for (int k = 0; k < points.size1(); k++) {
double
t1
=
points
(
k
,
0
);
//
double t1 = points(k, 0);
double
t2
=
points
(
k
,
1
);
//
double t2 = points(k, 1);
double
t3
=
points
(
k
,
2
);
//
double t3 = points(k, 2);
SPoint3
pos
;
//
SPoint3 pos;
_elementToScan
->
pnt
(
t1
,
t2
,
t3
,
pos
);
//
_elementToScan->pnt(t1, t2, t3, pos);
v
.
push_back
(
new
MVertex
(
pos
.
x
(),
pos
.
y
(),
pos
.
z
()));
//
v.push_back(new MVertex(pos.x(), pos.y(), pos.z()));
}
//
}
MElementFactory
factory
;
//
MElementFactory factory;
_hoElement
=
factory
.
create
(
tag
,
v
);
//
_hoElement = factory.create(tag, v);
fullVector
<
double
>
jac
;
fullVector
<
double
>
jac
;
jacobianBasedQuality
::
sampleJacobian
(
_elementToScan
,
_viewOrder
,
jacobianBasedQuality
::
sampleJacobian
(
_elementToScan
,
_viewOrder
,
...
@@ -569,9 +569,10 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
...
@@ -569,9 +569,10 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
if
(
_numElementToScan
==
-
7
)
{
if
(
_numElementToScan
==
-
7
)
{
const
int
type
=
el
->
getType
();
const
int
type
=
el
->
getType
();
// _jacAllElem[type].push_back(_jacElementToScan);
// _allElem[type].push_back(std::make_pair(el, _hoElement));
_allElem
[
type
].
push_back
(
std
::
make_pair
(
el
,
_hoElement
));
_allElem
[
type
].
push_back
(
std
::
make_pair
(
el
,
el
));
_dataPViewJacAllElements
[
type
][
_hoElement
->
getNum
()]
=
_jacElementToScan
;
// _dataPViewJacAllElements[type][_hoElement->getNum()] = _jacElementToScan;
_dataPViewJacAllElements
[
type
][
_elementToScan
->
getNum
()]
=
_jacElementToScan
;
}
}
}
}
...
@@ -626,33 +627,33 @@ void GMSH_AnalyseCurvedMeshPlugin::_addElementInEntity(MElement *element,
...
@@ -626,33 +627,33 @@ void GMSH_AnalyseCurvedMeshPlugin::_addElementInEntity(MElement *element,
void
GMSH_AnalyseCurvedMeshPlugin
::
_createPViewElementToScan
()
void
GMSH_AnalyseCurvedMeshPlugin
::
_createPViewElementToScan
()
{
{
if
(
!
_hoElement
)
return
;
// if (!_hoElement) return;
const
nodalBasis
*
fs
=
BasisFactory
::
getNodalBasis
(
_hoElement
->
getTypeForMSH
());
const
polynomialBasis
*
pfs
=
dynamic_cast
<
const
polynomialBasis
*>
(
fs
);
// Jacobian determinant
// Jacobian determinant
std
::
map
<
int
,
std
::
vector
<
double
>>
dataPView
;
std
::
map
<
int
,
std
::
vector
<
double
>>
dataPView
;
std
::
stringstream
name
;
std
::
stringstream
name
;
if
(
_numElementToScan
!=
-
7
)
{
if
(
_numElementToScan
!=
-
7
)
{
dataPView
[
_hoElement
->
getNum
()]
=
_jacElementToScan
;
// const nodalBasis *fs = BasisFactory::getNodalBasis(_hoElement->getTypeForMSH());
name
.
str
(
std
::
string
());
// const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
name
<<
"Jacobian elem "
<<
_numElementToScan
;
//
_addElementInEntity
(
_hoElement
,
_entity
);
// dataPView[_hoElement->getNum()] = _jacElementToScan;
PView
*
view
=
new
PView
(
name
.
str
().
c_str
(),
"ElementNodeData"
,
// name.str(std::string());
_m
,
dataPView
,
0
,
1
);
// name << "Jacobian elem " << _numElementToScan;
PViewData
*
viewData
=
view
->
getData
();
// _addElementInEntity(_hoElement, _entity);
viewData
->
deleteInterpolationMatrices
(
_hoElement
->
getType
());
// PView *view = new PView(name.str().c_str(), "ElementNodeData",
viewData
->
setInterpolationMatrices
(
_hoElement
->
getType
(),
// _m, dataPView, 0, 1);
pfs
->
coefficients
,
pfs
->
monomials
,
// PViewData *viewData = view->getData();
pfs
->
coefficients
,
pfs
->
monomials
);
// viewData->deleteInterpolationMatrices(_hoElement->getType());
// viewData->setInterpolationMatrices(_hoElement->getType(),
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
}
}
else
{
else
{
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
if
(
_dataPViewJacAllElements
[
type
].
empty
())
continue
;
if
(
_dataPViewJacAllElements
[
type
].
empty
())
continue
;
for
(
int
i
=
0
;
i
<
_allElem
[
type
].
size
();
++
i
)
{
//
for (int i = 0; i < _allElem[type].size(); ++i) {
_addElementInEntity
(
_allElem
[
type
][
i
].
second
,
_entity
);
//
_addElementInEntity(_allElem[type][i].second, _entity);
}
//
}
name
.
str
(
std
::
string
());
name
.
str
(
std
::
string
());
name
<<
"Jacobian all "
;
name
<<
"Jacobian all "
;
switch
(
type
)
{
switch
(
type
)
{
...
@@ -665,32 +666,40 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
...
@@ -665,32 +666,40 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
PViewData
*
viewData
=
view
->
getData
();
PViewData
*
viewData
=
view
->
getData
();
viewData
->
deleteInterpolationMatrices
(
type
);
viewData
->
deleteInterpolationMatrices
(
type
);
const
int
hoTag
=
_allElem
[
type
][
0
].
second
->
getTypeForMSH
();
// const int hoTag = _allElem[type][0].second->getTypeForMSH();
const
nodalBasis
*
fs
=
BasisFactory
::
getNodalBasis
(
hoTag
);
// const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag);
const
polynomialBasis
*
pfs
=
dynamic_cast
<
const
polynomialBasis
*>
(
fs
);
// const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
// viewData->setInterpolationMatrices(type,
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
const
nodalBasis
*
fsE
=
BasisFactory
::
getNodalBasis
(
_allElem
[
type
][
0
].
first
->
getTypeForMSH
());
const
polynomialBasis
*
pfsE
=
dynamic_cast
<
const
polynomialBasis
*>
(
fsE
);
const
int
hoTag
=
ElementType
::
getTag
(
type
,
_viewOrder
);
const
nodalBasis
*
fsV
=
BasisFactory
::
getNodalBasis
(
hoTag
);
const
polynomialBasis
*
pfsV
=
dynamic_cast
<
const
polynomialBasis
*>
(
fsV
);
viewData
->
setInterpolationMatrices
(
type
,
viewData
->
setInterpolationMatrices
(
type
,
pfs
->
coefficients
,
pfs
->
monomials
,
pfs
V
->
coefficients
,
pfs
V
->
monomials
,
pfs
->
coefficients
,
pfs
->
monomials
);
pfs
E
->
coefficients
,
pfs
E
->
monomials
);
}
}
}
}
// Quality measures
// Quality measures
fullVector
<
double
>
ige
;
fullVector
<
double
>
ige
;
if
(
_numElementToScan
!=
-
7
)
{
if
(
_numElementToScan
!=
-
7
)
{
jacobianBasedQuality
::
sampleIGEMeasure
(
_elementToScan
,
_viewOrder
,
ige
);
//
jacobianBasedQuality::sampleIGEMeasure(_elementToScan, _viewOrder, ige);
dataPView
.
clear
();
//
dataPView.clear();
for
(
int
j
=
0
;
j
<
ige
.
size
();
++
j
)
{
//
for (int j = 0; j < ige.size(); ++j) {
dataPView
[
_hoElement
->
getNum
()].
push_back
(
ige
(
j
));
//
dataPView[_hoElement->getNum()].push_back(ige(j));
}
//
}
name
.
str
(
std
::
string
());
//
name.str(std::string());
name
<<
"IGE elem "
<<
_numElementToScan
;
//
name << "IGE elem " << _numElementToScan;
PView
*
view
=
new
PView
(
name
.
str
().
c_str
(),
"ElementNodeData"
,
//
PView *view = new PView(name.str().c_str(), "ElementNodeData",
_m
,
dataPView
,
0
,
1
);
//
_m, dataPView, 0, 1);
PViewData
*
viewData
=
view
->
getData
();
//
PViewData *viewData = view->getData();
viewData
->
deleteInterpolationMatrices
(
_hoElement
->
getType
());
//
viewData->deleteInterpolationMatrices(_hoElement->getType());
viewData
->
setInterpolationMatrices
(
_hoElement
->
getType
(),
//
viewData->setInterpolationMatrices(_hoElement->getType(),
pfs
->
coefficients
,
pfs
->
monomials
,
//
pfs->coefficients, pfs->monomials,
pfs
->
coefficients
,
pfs
->
monomials
);
//
pfs->coefficients, pfs->monomials);
}
}
else
{
else
{
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
for
(
int
type
=
0
;
type
<
20
;
++
type
)
{
...
@@ -718,12 +727,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
...
@@ -718,12 +727,20 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
PViewData
*
viewData
=
view
->
getData
();
PViewData
*
viewData
=
view
->
getData
();
viewData
->
deleteInterpolationMatrices
(
type
);
viewData
->
deleteInterpolationMatrices
(
type
);
const
int
hoTag
=
_allElem
[
type
][
0
].
second
->
getTypeForMSH
();
// const int hoTag = _allElem[type][0].second->getTypeForMSH();
const
nodalBasis
*
fs
=
BasisFactory
::
getNodalBasis
(
hoTag
);
// const nodalBasis *fs = BasisFactory::getNodalBasis(hoTag);
const
polynomialBasis
*
pfs
=
dynamic_cast
<
const
polynomialBasis
*>
(
fs
);
// const polynomialBasis *pfs = dynamic_cast<const polynomialBasis*>(fs);
// viewData->setInterpolationMatrices(type,
// pfs->coefficients, pfs->monomials,
// pfs->coefficients, pfs->monomials);
const
nodalBasis
*
fsE
=
BasisFactory
::
getNodalBasis
(
_allElem
[
type
][
0
].
first
->
getTypeForMSH
());
const
polynomialBasis
*
pfsE
=
dynamic_cast
<
const
polynomialBasis
*>
(
fsE
);
const
int
hoTag
=
ElementType
::
getTag
(
type
,
_viewOrder
);
const
nodalBasis
*
fsV
=
BasisFactory
::
getNodalBasis
(
hoTag
);
const
polynomialBasis
*
pfsV
=
dynamic_cast
<
const
polynomialBasis
*>
(
fsV
);
viewData
->
setInterpolationMatrices
(
type
,
viewData
->
setInterpolationMatrices
(
type
,
pfs
->
coefficients
,
pfs
->
monomials
,
pfs
V
->
coefficients
,
pfs
V
->
monomials
,
pfs
->
coefficients
,
pfs
->
monomials
);
pfs
E
->
coefficients
,
pfs
E
->
monomials
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Plugin/AnalyseCurvedMesh.h
+
1
−
1
View file @
885e010d
...
@@ -44,7 +44,7 @@ private :
...
@@ -44,7 +44,7 @@ private :
// Element to scan
// Element to scan
int
_numElementToScan
;
int
_numElementToScan
;
MElement
*
_elementToScan
,
*
_hoElement
;
MElement
*
_elementToScan
,
*
_
_
hoElement
;
int
_viewOrder
;
int
_viewOrder
;
std
::
vector
<
double
>
_jacElementToScan
;
std
::
vector
<
double
>
_jacElementToScan
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment