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
75a489f5
Commit
75a489f5
authored
3 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
add option to specify physical group tag
parent
2103ea5c
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Plugin/Crack.cpp
+12
-4
12 additions, 4 deletions
Plugin/Crack.cpp
with
12 additions
and
4 deletions
Plugin/Crack.cpp
+
12
−
4
View file @
75a489f5
...
...
@@ -20,7 +20,9 @@ StringXNumber CrackOptions_Number[] = {
{
GMSH_FULLRC
,
"OpenBoundaryPhysicalGroup"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"NormalX"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"NormalY"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"NormalZ"
,
nullptr
,
1.
}};
{
GMSH_FULLRC
,
"NormalZ"
,
nullptr
,
1.
},
{
GMSH_FULLRC
,
"NewPhysicalGroup"
,
nullptr
,
0
}
};
extern
"C"
{
GMSH_Plugin
*
GMSH_RegisterCrackPlugin
()
{
return
new
GMSH_CrackPlugin
();
}
...
...
@@ -42,7 +44,10 @@ std::string GMSH_CrackPlugin::getHelp() const
"lips of the crack are sealed, i.e., its nodes are "
"not duplicated. For 1D cracks, `NormalX', `NormalY' and "
"`NormalZ' provide the reference normal of the surface "
"in which the crack is supposed to be embedded."
;
"in which the crack is supposed to be embedded. If "
"`NewPhysicalGroup' is positive, use it as the tag of "
"the newly created curve or surface; oterwise use "
"`PhysicalGroup'."
;
}
int
GMSH_CrackPlugin
::
getNbOptions
()
const
...
...
@@ -80,6 +85,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
int
open
=
(
int
)
CrackOptions_Number
[
2
].
def
;
SVector3
normal1d
(
CrackOptions_Number
[
3
].
def
,
CrackOptions_Number
[
4
].
def
,
CrackOptions_Number
[
5
].
def
);
int
newPhysical
=
(
int
)
CrackOptions_Number
[
6
].
def
;
if
(
dim
!=
1
&&
dim
!=
2
)
{
Msg
::
Error
(
"Crack dimension should be 1 or 2"
);
...
...
@@ -247,7 +253,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
// entity on the boundary, and correctly classify the nodes on it...
// and we also need to create boundary elements
// c) If we crack a group made of multiple elementary entities we might
// want to create multiple cracke
s
entities, and do the same as (b)
// want to create multiple cracke
d
entities, and do the same as (b)
// for all internal seams
//
// In practice, c) is not crucial - the current approach simply creates a
...
...
@@ -267,7 +273,7 @@ PView *GMSH_CrackPlugin::execute(PView *view)
}
GEntity
*
crackEntity
=
crackEdge
?
(
GEntity
*
)
crackEdge
:
(
GEntity
*
)
crackFace
;
crackEntity
->
physicals
.
push_back
(
physical
);
crackEntity
->
physicals
.
push_back
(
newPhysical
?
newPhysical
:
physical
);
// duplicate internal crack nodes
std
::
map
<
MVertex
*
,
MVertex
*>
vxv
;
...
...
@@ -304,6 +310,8 @@ PView *GMSH_CrackPlugin::execute(PView *view)
}
}
// m->pruneMeshVertexAssociations();
CTX
::
instance
()
->
mesh
.
changed
=
ENT_ALL
;
return
view
;
...
...
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