Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
205b4671
Commit
205b4671
authored
Dec 20, 2010
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added pre refinements for mesh in parallel computations.
parent
0f8097b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
0 deletions
+27
-0
AMDiS/src/Mesh.cc
AMDiS/src/Mesh.cc
+10
-0
AMDiS/src/parallel/MeshManipulation.cc
AMDiS/src/parallel/MeshManipulation.cc
+17
-0
No files found.
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
)
...
...
@@ -33,6 +36,10 @@ namespace AMDiS {
std
::
set
<
int
>
macrosProcessed
;
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
);
...
...
@@ -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
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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