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
Model registry
Operate
Environments
Monitor
Incidents
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
Larry Price
gmsh
Commits
c22262ae
Commit
c22262ae
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
global mesh size constraint per entity
parent
e349a9c1
No related branches found
No related tags found
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Geo/GEntity.h
+5
-0
5 additions, 0 deletions
Geo/GEntity.h
Geo/GFace.cpp
+8
-7
8 additions, 7 deletions
Geo/GFace.cpp
Geo/GFace.h
+9
-6
9 additions, 6 deletions
Geo/GFace.h
Geo/GVertex.h
+0
-2
0 additions, 2 deletions
Geo/GVertex.h
Mesh/BackgroundMeshTools.cpp
+7
-8
7 additions, 8 deletions
Mesh/BackgroundMeshTools.cpp
with
29 additions
and
23 deletions
Geo/GEntity.h
+
5
−
0
View file @
c22262ae
...
@@ -14,6 +14,8 @@
...
@@ -14,6 +14,8 @@
#include
"SBoundingBox3d.h"
#include
"SBoundingBox3d.h"
#include
"SOrientedBoundingBox.h"
#include
"SOrientedBoundingBox.h"
#define MAX_LC 1.e22
class
GModel
;
class
GModel
;
class
GVertex
;
class
GVertex
;
class
GEdge
;
class
GEdge
;
...
@@ -299,6 +301,9 @@ class GEntity {
...
@@ -299,6 +301,9 @@ class GEntity {
// reset the mesh attributes to default values
// reset the mesh attributes to default values
virtual
void
resetMeshAttributes
()
{
return
;
}
virtual
void
resetMeshAttributes
()
{
return
;
}
// global mesh size constraint for the entity
virtual
double
getMeshSize
()
const
{
return
MAX_LC
;
}
// number of types of elements
// number of types of elements
virtual
int
getNumElementTypes
()
const
{
return
0
;
}
virtual
int
getNumElementTypes
()
const
{
return
0
;
}
...
...
This diff is collapsed.
Click to expand it.
Geo/GFace.cpp
+
8
−
7
View file @
c22262ae
...
@@ -196,6 +196,7 @@ void GFace::resetMeshAttributes()
...
@@ -196,6 +196,7 @@ void GFace::resetMeshAttributes()
meshAttributes
.
transfiniteSmoothing
=
-
1
;
meshAttributes
.
transfiniteSmoothing
=
-
1
;
meshAttributes
.
extrude
=
0
;
meshAttributes
.
extrude
=
0
;
meshAttributes
.
reverseMesh
=
false
;
meshAttributes
.
reverseMesh
=
false
;
meshAttributes
.
meshSize
=
MAX_LC
;
}
}
SBoundingBox3d
GFace
::
bounds
()
const
SBoundingBox3d
GFace
::
bounds
()
const
...
...
This diff is collapsed.
Click to expand it.
Geo/GFace.h
+
9
−
6
View file @
c22262ae
...
@@ -314,12 +314,15 @@ class GFace : public GEntity{
...
@@ -314,12 +314,15 @@ class GFace : public GEntity{
ExtrudeParams
*
extrude
;
ExtrudeParams
*
extrude
;
// reverse mesh orientation
// reverse mesh orientation
bool
reverseMesh
;
bool
reverseMesh
;
// global mesh size constraint for the surface
double
meshSize
;
}
meshAttributes
;
}
meshAttributes
;
int
getMeshingAlgo
()
const
;
int
getMeshingAlgo
()
const
;
void
setMeshingAlgo
(
int
);
void
setMeshingAlgo
(
int
);
int
getCurvatureControlParameter
()
const
;
int
getCurvatureControlParameter
()
const
;
void
setCurvatureControlParameter
(
int
);
void
setCurvatureControlParameter
(
int
);
virtual
double
getMeshSize
()
const
{
return
meshAttributes
.
meshSize
;
}
struct
{
struct
{
mutable
GEntity
::
MeshGenerationStatus
status
;
mutable
GEntity
::
MeshGenerationStatus
status
;
...
...
This diff is collapsed.
Click to expand it.
Geo/GVertex.h
+
0
−
2
View file @
c22262ae
...
@@ -15,8 +15,6 @@
...
@@ -15,8 +15,6 @@
#include
"SPoint2.h"
#include
"SPoint2.h"
#include
"SPoint3.h"
#include
"SPoint3.h"
#define MAX_LC 1.e22
class
MElement
;
class
MElement
;
class
MPoint
;
class
MPoint
;
...
...
This diff is collapsed.
Click to expand it.
Mesh/BackgroundMeshTools.cpp
+
7
−
8
View file @
c22262ae
...
@@ -273,8 +273,11 @@ double BGM_MeshSize(GEntity *ge, double U, double V,
...
@@ -273,8 +273,11 @@ double BGM_MeshSize(GEntity *ge, double U, double V,
if
(
f
)
l4
=
(
*
f
)(
X
,
Y
,
Z
,
ge
);
if
(
f
)
l4
=
(
*
f
)(
X
,
Y
,
Z
,
ge
);
}
}
// global lc from entity
double
l5
=
ge
->
getMeshSize
();
// take the minimum, then constrain by lcMin and lcMax
// take the minimum, then constrain by lcMin and lcMax
double
lc
=
std
::
min
(
std
::
min
(
std
::
min
(
l1
,
l2
),
l3
),
l4
);
double
lc
=
std
::
min
(
std
::
min
(
std
::
min
(
std
::
min
(
l1
,
l2
),
l3
),
l4
)
,
l5
)
;
lc
=
std
::
max
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMin
);
lc
=
std
::
max
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMin
);
lc
=
std
::
min
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMax
);
lc
=
std
::
min
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMax
);
...
@@ -284,12 +287,6 @@ double BGM_MeshSize(GEntity *ge, double U, double V,
...
@@ -284,12 +287,6 @@ double BGM_MeshSize(GEntity *ge, double U, double V,
lc
=
l1
;
lc
=
l1
;
}
}
//Msg::Debug("BGM X,Y,Z=%g,%g,%g L4=%g L3=%g L2=%g L1=%g LC=%g LFINAL=%g DIM =%d ",
//X, Y, Z, l4, l3, l2, l1, lc, lc * CTX::instance()->mesh.lcFactor, ge->dim());
//Emi fix
//if (lc == l1) lc /= 10.;
return
lc
*
CTX
::
instance
()
->
mesh
.
lcFactor
;
return
lc
*
CTX
::
instance
()
->
mesh
.
lcFactor
;
}
}
...
@@ -304,7 +301,9 @@ SMetric3 BGM_MeshMetric(GEntity *ge,
...
@@ -304,7 +301,9 @@ SMetric3 BGM_MeshMetric(GEntity *ge,
// Element size = min. between default lc and lc from point (if applicable),
// Element size = min. between default lc and lc from point (if applicable),
// constrained by lcMin and lcMax
// constrained by lcMin and lcMax
double
lc
=
CTX
::
instance
()
->
lc
;
double
lc
=
CTX
::
instance
()
->
lc
;
if
(
CTX
::
instance
()
->
mesh
.
lcFromPoints
&&
ge
->
dim
()
<
2
)
lc
=
std
::
min
(
lc
,
LC_MVertex_PNTS
(
ge
,
U
,
V
));
if
(
CTX
::
instance
()
->
mesh
.
lcFromPoints
&&
ge
->
dim
()
<
2
)
lc
=
std
::
min
(
lc
,
LC_MVertex_PNTS
(
ge
,
U
,
V
));
lc
=
std
::
min
(
lc
,
ge
->
getMeshSize
());
lc
=
std
::
max
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMin
);
lc
=
std
::
max
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMin
);
lc
=
std
::
min
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMax
);
lc
=
std
::
min
(
lc
,
CTX
::
instance
()
->
mesh
.
lcMax
);
if
(
lc
<=
0.
){
if
(
lc
<=
0.
){
...
...
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