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
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Romin Tomasetti
gmsh
Commits
ef00f239
Commit
ef00f239
authored
7 years ago
by
Amaury Johnen
Browse files
Options
Downloads
Patches
Plain Diff
draw pview with all elements
parent
6f252593
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
Plugin/AnalyseCurvedMesh.cpp
+39
-17
39 additions, 17 deletions
Plugin/AnalyseCurvedMesh.cpp
Plugin/AnalyseCurvedMesh.h
+3
-0
3 additions, 0 deletions
Plugin/AnalyseCurvedMesh.h
with
42 additions
and
17 deletions
Plugin/AnalyseCurvedMesh.cpp
+
39
−
17
View file @
ef00f239
...
...
@@ -37,8 +37,7 @@ StringXNumber CurvedMeshOptions_Number[] = {
{
GMSH_FULLRC
,
"Draw PView"
,
NULL
,
0
},
{
GMSH_FULLRC
,
"Recompute"
,
NULL
,
1
},
{
GMSH_FULLRC
,
"Dimension of elements"
,
NULL
,
-
1
},
//{GMSH_FULLRC, "Element to print quality", NULL, 2485}
{
GMSH_FULLRC
,
"Element to print quality"
,
NULL
,
2901
}
{
GMSH_FULLRC
,
"Element to print quality"
,
NULL
,
-
7
}
};
extern
"C"
...
...
@@ -118,6 +117,8 @@ PView* GMSH_AnalyseCurvedMeshPlugin::execute(PView *v)
_viewOrder
=
10
;
_elementToScan
=
NULL
;
_hoElement
=
NULL
;
_allHoElements
.
clear
();
_jacAllElements
.
clear
();
if
(
askedDim
<
0
||
askedDim
>
4
)
askedDim
=
_m
->
getDim
();
...
...
@@ -537,8 +538,9 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
GEntity
*
entity
,
const
fullMatrix
<
double
>
*
normals
)
{
if
(
el
->
getNum
()
!=
_numElementToScan
)
return
;
if
(
_numElementToScan
!=
-
7
&&
el
->
getNum
()
!=
_numElementToScan
)
return
;
_entity
=
entity
;
_elementToScan
=
el
;
fullMatrix
<
double
>
points
=
_elementToScan
->
getFunctionSpace
(
_viewOrder
)
->
points
;
...
...
@@ -555,8 +557,6 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
MElementFactory
factory
;
_hoElement
=
factory
.
create
(
tag
,
v
);
_addElementInEntity
(
_hoElement
,
entity
);
fullVector
<
double
>
jac
;
jacobianBasedQuality
::
sampleJacobian
(
_elementToScan
,
_viewOrder
,
jac
,
normals
);
...
...
@@ -564,6 +564,11 @@ void GMSH_AnalyseCurvedMeshPlugin::_computeJacobianToScan(MElement *el,
for
(
int
j
=
0
;
j
<
jac
.
size
();
++
j
)
{
_jacElementToScan
.
push_back
(
jac
(
j
));
}
if
(
_numElementToScan
==
-
7
)
{
_jacAllElements
.
push_back
(
_jacElementToScan
);
_allHoElements
.
push_back
(
_hoElement
);
}
}
void
GMSH_AnalyseCurvedMeshPlugin
::
_addElementInEntity
(
MElement
*
element
,
...
...
@@ -618,14 +623,25 @@ void GMSH_AnalyseCurvedMeshPlugin::_addElementInEntity(MElement *element,
void
GMSH_AnalyseCurvedMeshPlugin
::
_createPViewElementToScan
()
{
if
(
!
_hoElement
)
return
;
const
nodalBasis
*
fs
=
BasisFactory
::
getNodalBasis
(
_hoElement
->
getTypeForMSH
());
const
polynomialBasis
*
pfs
=
dynamic_cast
<
const
polynomialBasis
*>
(
fs
);
// Jacobian determinant
std
::
map
<
int
,
std
::
vector
<
double
>>
dataPView
;
dataPView
[
_hoElement
->
getNum
()]
=
_jacElementToScan
;
std
::
stringstream
name
;
if
(
_numElementToScan
!=
-
7
)
{
dataPView
[
_hoElement
->
getNum
()]
=
_jacElementToScan
;
name
<<
"Jacobian elem "
<<
_numElementToScan
;
_addElementInEntity
(
_hoElement
,
_entity
);
}
else
{
for
(
int
i
=
0
;
i
<
_allHoElements
.
size
();
++
i
)
{
dataPView
[
_allHoElements
[
i
]
->
getNum
()]
=
_jacAllElements
[
i
];
_addElementInEntity
(
_allHoElements
[
i
],
_entity
);
}
name
<<
"Jacobian all elem"
;
}
PView
*
view
=
new
PView
(
name
.
str
().
c_str
(),
"ElementNodeData"
,
_m
,
dataPView
,
0
,
1
);
PViewData
*
viewData
=
view
->
getData
();
...
...
@@ -633,21 +649,27 @@ void GMSH_AnalyseCurvedMeshPlugin::_createPViewElementToScan()
viewData
->
setInterpolationMatrices
(
_hoElement
->
getType
(),
pfs
->
coefficients
,
pfs
->
monomials
,
pfs
->
coefficients
,
pfs
->
monomials
);
// PView *view;
// PViewData *viewData;
// Quality measures
fullVector
<
double
>
ige
;
jacobianBasedQuality
::
sampleIGEMeasure
(
_elementToScan
,
_viewOrder
,
ige
);
//std::map<int, std::vector<double>> dataPView2;
dataPView
[
_hoElement
->
getNum
()].
clear
();
name
.
str
(
std
::
string
());
if
(
_numElementToScan
!=
-
7
)
{
jacobianBasedQuality
::
sampleIGEMeasure
(
_elementToScan
,
_viewOrder
,
ige
);
for
(
int
j
=
0
;
j
<
ige
.
size
();
++
j
)
{
dataPView
[
_hoElement
->
getNum
()].
push_back
(
ige
(
j
));
}
name
.
str
(
std
::
string
());
name
<<
"IGE elem "
<<
_numElementToScan
;
// BUG, essayer en créant de nouveau dataPView
}
else
{
for
(
int
i
=
0
;
i
<
_allHoElements
.
size
();
++
i
)
{
jacobianBasedQuality
::
sampleIGEMeasure
(
_data
[
i
].
element
(),
_viewOrder
,
ige
);
for
(
int
j
=
0
;
j
<
ige
.
size
();
++
j
)
{
dataPView
[
_allHoElements
[
i
]
->
getNum
()].
push_back
(
ige
(
j
));
}
}
name
<<
"IGE all elem"
;
}
view
=
new
PView
(
name
.
str
().
c_str
(),
"ElementNodeData"
,
_m
,
dataPView
,
0
,
1
);
viewData
=
view
->
getData
();
viewData
->
deleteInterpolationMatrices
(
_hoElement
->
getType
());
...
...
This diff is collapsed.
Click to expand it.
Plugin/AnalyseCurvedMesh.h
+
3
−
0
View file @
ef00f239
...
...
@@ -47,6 +47,9 @@ private :
MElement
*
_elementToScan
,
*
_hoElement
;
int
_viewOrder
;
std
::
vector
<
double
>
_jacElementToScan
;
std
::
vector
<
std
::
vector
<
double
>>
_jacAllElements
;
std
::
vector
<
MElement
*>
_allHoElements
;
GEntity
*
_entity
;
// for 1d, 2d, 3d
bool
_computedJac
[
3
],
_computedIGE
[
3
],
_computedICN
[
3
];
...
...
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