Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Backofen, Rainer
amdis
Commits
205b4671
Commit
205b4671
authored
Dec 20, 2010
by
Thomas Witkowski
Browse files
Added pre refinements for mesh in parallel computations.
parent
0f8097b4
Changes
2
Show whitespace changes
Inline
Side-by-side
AMDiS/src/Mesh.cc
View file @
205b4671
...
...
@@ -1280,6 +1280,16 @@ namespace AMDiS {
}
// === Check if number of pre refinements is set ini init file. ===
int
nPreRefine
=
0
;
GET_PARAMETER
(
0
,
"parallel->pre refine"
,
"%d"
,
&
nPreRefine
);
if
(
nPreRefine
!=
0
)
{
MSG
(
"Calculated %d pre refines to be useful, but %d are set in init file!
\n
"
,
nrRefine
,
nPreRefine
);
nrRefine
=
nPreRefine
;
}
// === If we do not need to refine the mesh, return back. ===
if
(
nrRefine
==
0
)
...
...
AMDiS/src/parallel/MeshManipulation.cc
View file @
205b4671
...
...
@@ -25,6 +25,9 @@ namespace AMDiS {
TEST_EXIT
(
mesh
->
getDim
()
==
2
)(
"Not yet supported for dim != 2!
\n
"
);
// Create data structure that maps macro element indices to the
// corresponding pointers.
std
::
map
<
int
,
MacroElement
*>
macroIndexMap
;
for
(
std
::
set
<
MacroElement
*>::
iterator
it
=
newMacroEl
.
begin
();
it
!=
newMacroEl
.
end
();
++
it
)
...
...
@@ -34,6 +37,10 @@ namespace AMDiS {
std
::
map
<
const
DegreeOfFreedom
*
,
const
DegreeOfFreedom
*>
mapDelDofs
;
// === Traverse mesh and put all "old" macro element to macrosProcessed ===
// === that stores all macro elements which are really conected to the ===
// === overall mesh structure. ===
TraverseStack
stack
;
ElInfo
*
elInfo
=
stack
.
traverseFirst
(
mesh
,
0
,
Mesh
::
CALL_EL_LEVEL
);
while
(
elInfo
)
{
...
...
@@ -48,6 +55,10 @@ namespace AMDiS {
}
// === Traverse all new elements and connect them to the overall mesh ===
// === structure by deleting all double DOFs on macro element's vertices, ===
// === edges and faces. ===
for
(
std
::
set
<
MacroElement
*>::
iterator
it
=
newMacroEl
.
begin
();
it
!=
newMacroEl
.
end
();
++
it
)
{
...
...
@@ -127,6 +138,8 @@ namespace AMDiS {
}
// === Remove all DOF replacments of the form A -> B, B -> C by A -> C. ===
bool
changed
=
false
;
do
{
changed
=
false
;
...
...
@@ -144,6 +157,8 @@ namespace AMDiS {
}
while
(
changed
);
// === Set new DOF pointers in all elements of the mesh. ===
elInfo
=
stack
.
traverseFirst
(
mesh
,
-
1
,
Mesh
::
CALL_EVERY_EL_PREORDER
);
while
(
elInfo
)
{
for
(
int
i
=
0
;
i
<
mesh
->
getGeo
(
VERTEX
);
i
++
)
...
...
@@ -154,6 +169,8 @@ namespace AMDiS {
}
// === And delete all double DOFs. ===
for
(
std
::
map
<
const
DegreeOfFreedom
*
,
const
DegreeOfFreedom
*>::
iterator
it
=
mapDelDofs
.
begin
();
it
!=
mapDelDofs
.
end
();
++
it
)
mesh
->
freeDof
(
const_cast
<
DegreeOfFreedom
*>
(
it
->
first
),
VERTEX
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment