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
ba4cca1c
Commit
ba4cca1c
authored
9 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
basic remesh
parent
626e5508
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Geo/discreteRegion.cpp
+19
-2
19 additions, 2 deletions
Geo/discreteRegion.cpp
Mesh/meshGRegion.cpp
+4
-4
4 additions, 4 deletions
Mesh/meshGRegion.cpp
Mesh/meshGRegion.h
+2
-2
2 additions, 2 deletions
Mesh/meshGRegion.h
utils/api_demos/mainRemesh.cpp
+4
-0
4 additions, 0 deletions
utils/api_demos/mainRemesh.cpp
with
29 additions
and
8 deletions
Geo/discreteRegion.cpp
+
19
−
2
View file @
ba4cca1c
...
...
@@ -10,6 +10,7 @@
#include
"Context.h"
#if defined(HAVE_MESH)
#include
"meshGRegion.h"
#include
"meshGRegionDelaunayInsertion.h"
#endif
...
...
@@ -61,13 +62,29 @@ void discreteRegion::findFaces(std::map<MFace, std::vector<int>, Less_Face> &map
void
discreteRegion
::
remesh
()
{
#if defined(HAVE_MESH)
bool
classify
=
false
;
if
(
CTX
::
instance
()
->
mesh
.
oldRefinement
){
insertVerticesInRegion
(
this
,
2000000000
,
true
);
insertVerticesInRegion
(
this
,
2000000000
,
classify
);
}
else
{
insertVerticesInRegion
(
this
,
0
);
insertVerticesInRegion
(
this
,
0
,
classify
);
void
edgeBasedRefinement
(
const
int
numThreads
,
const
int
nptsatonce
,
GRegion
*
gr
);
edgeBasedRefinement
(
1
,
1
,
this
);
}
// not functional yet: need boundaries
for
(
int
i
=
0
;
i
<
std
::
max
(
CTX
::
instance
()
->
mesh
.
optimize
,
CTX
::
instance
()
->
mesh
.
optimizeNetgen
);
i
++
){
if
(
CTX
::
instance
()
->
mesh
.
optimize
>=
i
){
printf
(
"optimizing!
\n
"
);
optimizeMeshGRegionGmsh
opt
;
opt
(
this
,
true
);
}
if
(
CTX
::
instance
()
->
mesh
.
optimizeNetgen
>=
i
){
printf
(
"optimizing netgen!
\n
"
);
optimizeMeshGRegionNetgen
opt
;
opt
(
this
,
true
);
}
}
#endif
}
This diff is collapsed.
Click to expand it.
Mesh/meshGRegion.cpp
+
4
−
4
View file @
ba4cca1c
...
...
@@ -997,11 +997,11 @@ void meshGRegion::operator() (GRegion *gr)
}
void
optimizeMeshGRegionNetgen
::
operator
()
(
GRegion
*
gr
)
void
optimizeMeshGRegionNetgen
::
operator
()
(
GRegion
*
gr
,
bool
always
)
{
gr
->
model
()
->
setCurrentMeshEntity
(
gr
);
if
(
gr
->
geomType
()
==
GEntity
::
DiscreteVolume
)
return
;
if
(
!
always
&&
gr
->
geomType
()
==
GEntity
::
DiscreteVolume
)
return
;
// don't optimize transfinite or extruded meshes
if
(
gr
->
meshAttributes
.
method
==
MESH_TRANSFINITE
)
return
;
...
...
@@ -1026,11 +1026,11 @@ void optimizeMeshGRegionNetgen::operator() (GRegion *gr)
#endif
}
void
optimizeMeshGRegionGmsh
::
operator
()
(
GRegion
*
gr
)
void
optimizeMeshGRegionGmsh
::
operator
()
(
GRegion
*
gr
,
bool
always
)
{
gr
->
model
()
->
setCurrentMeshEntity
(
gr
);
if
(
gr
->
geomType
()
==
GEntity
::
DiscreteVolume
)
return
;
if
(
!
always
&&
gr
->
geomType
()
==
GEntity
::
DiscreteVolume
)
return
;
// don't optimize extruded meshes
if
(
gr
->
meshAttributes
.
method
==
MESH_TRANSFINITE
)
return
;
...
...
This diff is collapsed.
Click to expand it.
Mesh/meshGRegion.h
+
2
−
2
View file @
ba4cca1c
...
...
@@ -35,13 +35,13 @@ class meshGRegionExtruded {
// Optimize the mesh of the region using gmsh's algo
class
optimizeMeshGRegionGmsh
{
public
:
void
operator
()
(
GRegion
*
);
void
operator
()
(
GRegion
*
,
bool
always
=
false
);
};
// Optimize the mesh of the region using netgen's algo
class
optimizeMeshGRegionNetgen
{
public
:
void
operator
()
(
GRegion
*
);
void
operator
()
(
GRegion
*
,
bool
always
=
false
);
};
// destroy the mesh of the region
...
...
This diff is collapsed.
Click to expand it.
utils/api_demos/mainRemesh.cpp
+
4
−
0
View file @
ba4cca1c
...
...
@@ -7,11 +7,15 @@
int
main
(
int
argc
,
char
**
argv
)
{
GmshInitialize
(
argc
,
argv
);
GmshSetOption
(
"General"
,
"Terminal"
,
1.
);
GmshSetOption
(
"General"
,
"Verbosity"
,
4.
);
GmshSetOption
(
"Mesh"
,
"CharacteristicLengthExtendFromBoundary"
,
1.
);
GmshSetOption
(
"Mesh"
,
"OldRefinement"
,
1.
);
GmshSetOption
(
"Mesh"
,
"CharacteristicLengthMin"
,
0.1
);
GmshSetOption
(
"Mesh"
,
"CharacteristicLengthMax"
,
0.1
);
GmshSetOption
(
"Mesh"
,
"Optimize"
,
0.
);
// not yet: need boundary!
GModel
*
m
=
new
GModel
();
m
->
readMSH
(
"cube.msh"
);
...
...
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