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
81f6beea
Commit
81f6beea
authored
11 years ago
by
Amaury Johnen
Browse files
Options
Downloads
Patches
Plain Diff
update of plugin AnalyseCurvedMesh. Can now compute metric. Interface improved.
parent
016a5fdf
No related branches found
No related tags found
No related merge requests found
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/MElement.cpp
+2
-2
2 additions, 2 deletions
Geo/MElement.cpp
Geo/MElement.h
+1
-1
1 addition, 1 deletion
Geo/MElement.h
Plugin/AnalyseCurvedMesh.cpp
+345
-506
345 additions, 506 deletions
Plugin/AnalyseCurvedMesh.cpp
Plugin/AnalyseCurvedMesh.h
+66
-33
66 additions, 33 deletions
Plugin/AnalyseCurvedMesh.h
with
414 additions
and
542 deletions
Geo/MElement.cpp
+
2
−
2
View file @
81f6beea
...
@@ -468,11 +468,11 @@ void MElement::getSignedJacobian(fullVector<double> &jacobian, int o)
...
@@ -468,11 +468,11 @@ void MElement::getSignedJacobian(fullVector<double> &jacobian, int o)
getJacobianFuncSpace
(
o
)
->
getSignedJacobian
(
nodesXYZ
,
jacobian
);
getJacobianFuncSpace
(
o
)
->
getSignedJacobian
(
nodesXYZ
,
jacobian
);
}
}
void
MElement
::
getNodesCoord
(
fullMatrix
<
double
>
&
nodesXYZ
)
void
MElement
::
getNodesCoord
(
fullMatrix
<
double
>
&
nodesXYZ
)
const
{
{
const
int
numNodes
=
getNumShapeFunctions
();
const
int
numNodes
=
getNumShapeFunctions
();
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
{
for
(
int
i
=
0
;
i
<
numNodes
;
i
++
)
{
MVertex
*
v
=
getShapeFunctionNode
(
i
);
const
MVertex
*
v
=
getShapeFunctionNode
(
i
);
nodesXYZ
(
i
,
0
)
=
v
->
x
();
nodesXYZ
(
i
,
0
)
=
v
->
x
();
nodesXYZ
(
i
,
1
)
=
v
->
y
();
nodesXYZ
(
i
,
1
)
=
v
->
y
();
nodesXYZ
(
i
,
2
)
=
v
->
z
();
nodesXYZ
(
i
,
2
)
=
v
->
z
();
...
...
This diff is collapsed.
Click to expand it.
Geo/MElement.h
+
1
−
1
View file @
81f6beea
...
@@ -272,7 +272,7 @@ class MElement
...
@@ -272,7 +272,7 @@ class MElement
double
jac
[
3
][
3
];
return
getJacobian
(
u
,
v
,
w
,
jac
);
double
jac
[
3
][
3
];
return
getJacobian
(
u
,
v
,
w
,
jac
);
}
}
void
getSignedJacobian
(
fullVector
<
double
>
&
jacobian
,
int
o
=
-
1
);
void
getSignedJacobian
(
fullVector
<
double
>
&
jacobian
,
int
o
=
-
1
);
void
getNodesCoord
(
fullMatrix
<
double
>
&
nodesXYZ
);
void
getNodesCoord
(
fullMatrix
<
double
>
&
nodesXYZ
)
const
;
virtual
int
getNumShapeFunctions
()
const
{
return
getNumVertices
();
}
virtual
int
getNumShapeFunctions
()
const
{
return
getNumVertices
();
}
virtual
int
getNumPrimaryShapeFunctions
()
{
return
getNumPrimaryVertices
();
}
virtual
int
getNumPrimaryShapeFunctions
()
{
return
getNumPrimaryVertices
();
}
virtual
const
MVertex
*
getShapeFunctionNode
(
int
i
)
const
{
return
getVertex
(
i
);
}
virtual
const
MVertex
*
getShapeFunctionNode
(
int
i
)
const
{
return
getVertex
(
i
);
}
...
...
This diff is collapsed.
Click to expand it.
Plugin/AnalyseCurvedMesh.cpp
+
345
−
506
View file @
81f6beea
This diff is collapsed.
Click to expand it.
Plugin/AnalyseCurvedMesh.h
+
66
−
33
View file @
81f6beea
...
@@ -7,7 +7,10 @@
...
@@ -7,7 +7,10 @@
#define _ANALYSECURVEDMESH_H_
#define _ANALYSECURVEDMESH_H_
#include
"Plugin.h"
#include
"Plugin.h"
#include
"JacobianBasis.h"
#include
"MetricBasis.h"
#include
"MElement.h"
#include
"MElement.h"
#include
<vector>
#include
<vector>
extern
"C"
extern
"C"
...
@@ -15,41 +18,71 @@ extern "C"
...
@@ -15,41 +18,71 @@ extern "C"
GMSH_Plugin
*
GMSH_RegisterAnalyseCurvedMeshPlugin
();
GMSH_Plugin
*
GMSH_RegisterAnalyseCurvedMeshPlugin
();
}
}
class
CurvedMeshPluginData
{
private:
MElement
*
_el
;
double
_minJ
,
_maxJ
,
_minR
;
public:
CurvedMeshPluginData
(
MElement
*
e
,
double
minJ
=
2
,
double
maxJ
=
0
,
double
minR
=
-
1
)
:
_el
(
e
),
_minJ
(
minJ
),
_maxJ
(
maxJ
),
_minR
(
minR
)
{}
void
setMinR
(
double
r
)
{
_minR
=
r
;}
MElement
*
element
()
{
return
_el
;}
double
minJ
()
{
return
_minJ
;}
double
maxJ
()
{
return
_maxJ
;}
double
minR
()
{
return
_minR
;}
};
class
GMSH_AnalyseCurvedMeshPlugin
:
public
GMSH_PostPlugin
class
GMSH_AnalyseCurvedMeshPlugin
:
public
GMSH_PostPlugin
{
{
private
:
private
:
int
_dim
;
int
_dim
;
GModel
*
_m
;
GModel
*
_m
;
int
_maxDepth
;
double
_threshold
,
_tol
;
double
_jacBreak
,
_bezBreak
,
_tol
;
int
_numPView
,
_computeMetric
;
bool
_recompute
;
bool
_computedR3D
,
_computedR2D
;
bool
_computedJ3D
,
_computedJ2D
,
_computedJ1D
;
bool
_1PViewJ
,
_2PViewJ
,
_1PViewR
,
_2PViewR
;
bool
_msgHide
;
int
_numAnalysedEl
;
std
::
vector
<
CurvedMeshPluginData
>
_data
;
int
_numInvalid
,
_numValid
,
_numUncertain
;
double
_min_pJmin
,
_avg_pJmin
;
double
_min_ratioJ
,
_avg_ratioJ
;
public
:
public
:
GMSH_AnalyseCurvedMeshPlugin
(){}
GMSH_AnalyseCurvedMeshPlugin
()
{
_computedR3D
=
false
;
_computedR2D
=
false
;
_computedJ3D
=
false
;
_computedJ2D
=
false
;
_computedJ1D
=
false
;
_msgHide
=
true
;
_1PViewJ
=
false
;
_2PViewJ
=
false
;
_1PViewR
=
false
;
_2PViewR
=
false
;
}
std
::
string
getName
()
const
{
return
"AnalyseCurvedMesh"
;
}
std
::
string
getName
()
const
{
return
"AnalyseCurvedMesh"
;
}
std
::
string
getShortHelp
()
const
{
std
::
string
getShortHelp
()
const
{
return
"C
heck validity of elements and/or compute min&max of the jacobian
"
;
return
"C
ompute bounds on Jacobian and metric quality.
"
;
}
}
std
::
string
getHelp
()
const
;
std
::
string
getHelp
()
const
;
std
::
string
getAuthor
()
const
{
return
"Amaury Johnen"
;
}
std
::
string
getAuthor
()
const
{
return
"Amaury Johnen"
;
}
int
getNbOptions
()
const
;
int
getNbOptions
()
const
;
StringXNumber
*
getOption
(
int
);
StringXNumber
*
getOption
(
int
);
PView
*
execute
(
PView
*
);
PView
*
execute
(
PView
*
);
void
checkValidity
(
MElement
*
const
*
,
int
numEl
,
std
::
vector
<
MElement
*>
&
invalids
);
//void storeJMin(MElement *const *, int numEl, std::map<int, std::vector<double> > &data);
private
:
private
:
void
checkValidity
(
int
toDo
);
void
_computeMinMaxJandValidity
();
void
computeMinMax
(
std
::
map
<
int
,
std
::
vector
<
double
>
>
*
data
=
0
);
void
_computeMinMaxJandValidity
(
MElement
*
const
*
,
int
numEl
);
void
computeMinMax
(
MElement
*
const
*
,
int
numEl
,
std
::
map
<
int
,
std
::
vector
<
double
>
>
*
data
=
0
);
void
_computeMinR
();
int
subDivision
(
const
JacobianBasis
*
,
const
fullVector
<
double
>&
,
int
depth
);
bool
_hideWithThreshold
();
void
hideValid_ShowInvalid
(
std
::
vector
<
MElement
*>
&
invalids
);
void
_printStatMetric
();
void
_printStatJacobian
();
};
};
#endif
#endif
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