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
ee0e6c87
Commit
ee0e6c87
authored
3 years ago
by
Christophe Geuzaine
Browse files
Options
Downloads
Patches
Plain Diff
merged AuxiliaryPhysicalGroup patch from
@schnaubelt
parent
dd95ac79
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
src/plugin/Crack.cpp
+35
-4
35 additions, 4 deletions
src/plugin/Crack.cpp
with
35 additions
and
4 deletions
src/plugin/Crack.cpp
+
35
−
4
View file @
ee0e6c87
...
...
@@ -18,6 +18,7 @@ StringXNumber CrackOptions_Number[] = {
{
GMSH_FULLRC
,
"Dimension"
,
nullptr
,
1.
},
{
GMSH_FULLRC
,
"PhysicalGroup"
,
nullptr
,
1.
},
{
GMSH_FULLRC
,
"OpenBoundaryPhysicalGroup"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"AuxiliaryPhysicalGroup"
,
nullptr
,
0
},
{
GMSH_FULLRC
,
"NormalX"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"NormalY"
,
nullptr
,
0.
},
{
GMSH_FULLRC
,
"NormalZ"
,
nullptr
,
1.
},
...
...
@@ -84,10 +85,11 @@ PView *GMSH_CrackPlugin::execute(PView *view)
int
dim
=
(
int
)
CrackOptions_Number
[
0
].
def
;
int
physical
=
(
int
)
CrackOptions_Number
[
1
].
def
;
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
;
int
debug
=
(
int
)
CrackOptions_Number
[
7
].
def
;
int
aux
=
(
int
)
CrackOptions_Number
[
3
].
def
;
SVector3
normal1d
(
CrackOptions_Number
[
4
].
def
,
CrackOptions_Number
[
5
].
def
,
CrackOptions_Number
[
6
].
def
);
int
newPhysical
=
(
int
)
CrackOptions_Number
[
7
].
def
;
int
debug
=
(
int
)
CrackOptions_Number
[
8
].
def
;
if
(
dim
!=
1
&&
dim
!=
2
)
{
Msg
::
Error
(
"Crack dimension should be 1 or 2"
);
...
...
@@ -114,6 +116,16 @@ PView *GMSH_CrackPlugin::execute(PView *view)
}
}
std
::
vector
<
GEntity
*>
auxEntities
;
if
(
aux
>
0
)
{
auxEntities
=
groups
[
dim
][
aux
];
if
(
auxEntities
.
empty
())
{
Msg
::
Warning
(
"Auxiliary physical group %d (dimension %d) is empty"
,
aux
,
dim
);
return
view
;
}
}
std
::
set
<
GEntity
*>
crackEntities
;
crackEntities
.
insert
(
entities
.
begin
(),
entities
.
end
());
crackEntities
.
insert
(
openEntities
.
begin
(),
openEntities
.
end
());
...
...
@@ -211,6 +223,25 @@ PView *GMSH_CrackPlugin::execute(PView *view)
for
(
auto
it
=
bndVertices
.
begin
();
it
!=
bndVertices
.
end
();
it
++
)
crackVertices
.
erase
(
*
it
);
// get auxiliary elements
std
::
vector
<
MElement
*>
auxElements
;
for
(
std
::
size_t
i
=
0
;
i
<
auxEntities
.
size
();
i
++
)
for
(
std
::
size_t
j
=
0
;
j
<
auxEntities
[
i
]
->
getNumMeshElements
();
j
++
)
auxElements
.
push_back
(
auxEntities
[
i
]
->
getMeshElement
(
j
));
// add auxiliary elements to crackVertices if they are connected to the
// vertex (see #1750)
for
(
std
::
size_t
i
=
0
;
i
<
auxElements
.
size
();
i
++
)
{
for
(
std
::
size_t
j
=
0
;
j
<
auxElements
[
i
]
->
getNumVertices
();
j
++
)
{
MVertex
*
v
=
auxElements
[
i
]
->
getVertex
(
j
);
auto
it
=
crackVertices
.
find
(
v
);
// vertex v is in crackVertices: add aux element to vector of connected
// elements
if
(
it
!=
crackVertices
.
end
())
it
->
second
.
push_back
(
auxElements
[
i
]);
}
}
// compute elements on the positive side of the crack, and keep track of each
// node in the element that leads to categorizing the element on this side
// (this allows to handle the degenerate case where the same element touches
...
...
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