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
iwr
amdis
Commits
cbc573e3
Commit
cbc573e3
authored
Jul 12, 2010
by
Thomas Witkowski
Browse files
Fixed refinement bug in 3D.
parent
abac1efd
Changes
7
Hide whitespace changes
Inline
Side-by-side
AMDiS/libtool
View file @
cbc573e3
...
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
...
@@ -44,7 +44,7 @@ available_tags=" CXX F77"
# ### BEGIN LIBTOOL CONFIG
# ### BEGIN LIBTOOL CONFIG
# Libtool was configured on host deimos10
2
:
# Libtool was configured on host deimos10
3
:
# Shell to use when invoking shell scripts.
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
SHELL
=
"/bin/sh"
...
@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
...
@@ -6760,7 +6760,7 @@ build_old_libs=`case $build_libtool_libs in yes) $echo no;; *) $echo yes;; esac`
# End:
# End:
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# ### BEGIN LIBTOOL TAG CONFIG: CXX
# Libtool was configured on host deimos10
2
:
# Libtool was configured on host deimos10
3
:
# Shell to use when invoking shell scripts.
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
SHELL
=
"/bin/sh"
...
@@ -7065,7 +7065,7 @@ include_expsyms=""
...
@@ -7065,7 +7065,7 @@ include_expsyms=""
# ### BEGIN LIBTOOL TAG CONFIG: F77
# ### BEGIN LIBTOOL TAG CONFIG: F77
# Libtool was configured on host deimos10
2
:
# Libtool was configured on host deimos10
3
:
# Shell to use when invoking shell scripts.
# Shell to use when invoking shell scripts.
SHELL
=
"/bin/sh"
SHELL
=
"/bin/sh"
...
...
AMDiS/other/include/Makefile_AMDiS.mk
View file @
cbc573e3
...
@@ -68,6 +68,10 @@ endif
...
@@ -68,6 +68,10 @@ endif
# ============================================================================
# ============================================================================
ifeq
($(strip $(USE_PARALLEL_AMDIS)), 1)
ifeq
($(strip $(USE_PARALLEL_AMDIS)), 1)
include
${PETSC_DIR}/conf/variables
CFLAGS
=
${PETSC_CC_INCLUDES}
FFLAGS
=
${PETSC_FC_INCLUDES}
ifeq
($(strip $(USE_SERVER)), mars)
ifeq
($(strip $(USE_SERVER)), mars)
ifeq
($(strip $(USE_COMPILER)), gcc)
ifeq
($(strip $(USE_COMPILER)), gcc)
COMPILE
=
g++
COMPILE
=
g++
...
@@ -78,8 +82,9 @@ ifeq ($(strip $(USE_PARALLEL_AMDIS)), 1)
...
@@ -78,8 +82,9 @@ ifeq ($(strip $(USE_PARALLEL_AMDIS)), 1)
COMPILE
=
$(MPI_DIR)
/bin/mpiCC
COMPILE
=
$(MPI_DIR)
/bin/mpiCC
endif
endif
LIBS
+=
$(PARMETIS_LIB)
-lmpi
CPPFLAGS
+=
-DHAVE_PARALLEL_DOMAIN_AMDIS
CPPFLAGS
+=
-DHAVE_PARALLEL_DOMAIN_AMDIS
INCLUDES
+=
$(PETSC_INCLUDE)
LIBS
+=
$(PARMETIS_LIB)
-lmpi
$(PETSC_LIB)
else
else
ifeq
($(strip $(USE_COMPILER)), gcc)
ifeq
($(strip $(USE_COMPILER)), gcc)
COMPILE
=
g++
COMPILE
=
g++
...
@@ -116,7 +121,12 @@ endif
...
@@ -116,7 +121,12 @@ endif
# ============================================================================
# ============================================================================
LIBTOOL
=
$(AMDIS_DIR)
/libtool
LIBTOOL
=
$(AMDIS_DIR)
/libtool
LINK
=
$(LIBTOOL)
--mode
=
link
$(COMPILE)
ifeq
($(strip $(USE_PARALLEL_AMDIS)), 1)
LINK
=
$(LIBTOOL)
--tag
=
mpiCC
--mode
=
link
$(COMPILE)
else
LINK
=
$(LIBTOOL)
--mode
=
link
$(COMPILE)
endif
# ============================================================================
# ============================================================================
# ===== rules ================================================================
# ===== rules ================================================================
...
...
AMDiS/src/Element.h
View file @
cbc573e3
...
@@ -106,7 +106,7 @@ namespace AMDiS {
...
@@ -106,7 +106,7 @@ namespace AMDiS {
/// Returns \ref child[i], i=0,1
/// Returns \ref child[i], i=0,1
inline
Element
*
getChild
(
int
i
)
const
inline
Element
*
getChild
(
int
i
)
const
{
{
TEST_EXIT_DBG
(
i
==
0
||
i
==
1
)(
"
i must be 0 or 1
\n
"
);
TEST_EXIT_DBG
(
i
==
0
||
i
==
1
)(
"
There is only child 0 or 1! (i = %d)
\n
"
,
i
);
return
child
[
i
];
return
child
[
i
];
}
}
...
...
AMDiS/src/Mesh.cc
View file @
cbc573e3
...
@@ -1149,6 +1149,7 @@ namespace AMDiS {
...
@@ -1149,6 +1149,7 @@ namespace AMDiS {
initialized
=
true
;
initialized
=
true
;
}
}
bool
Mesh
::
associated
(
DegreeOfFreedom
dof1
,
DegreeOfFreedom
dof2
)
bool
Mesh
::
associated
(
DegreeOfFreedom
dof1
,
DegreeOfFreedom
dof2
)
{
{
std
::
map
<
BoundaryType
,
VertexVector
*>::
iterator
it
;
std
::
map
<
BoundaryType
,
VertexVector
*>::
iterator
it
;
...
@@ -1159,6 +1160,7 @@ namespace AMDiS {
...
@@ -1159,6 +1160,7 @@ namespace AMDiS {
return
false
;
return
false
;
}
}
bool
Mesh
::
indirectlyAssociated
(
DegreeOfFreedom
dof1
,
DegreeOfFreedom
dof2
)
bool
Mesh
::
indirectlyAssociated
(
DegreeOfFreedom
dof1
,
DegreeOfFreedom
dof2
)
{
{
std
::
vector
<
DegreeOfFreedom
>
associatedToDOF1
;
std
::
vector
<
DegreeOfFreedom
>
associatedToDOF1
;
...
...
AMDiS/src/RefinementManager3d.cc
View file @
cbc573e3
...
@@ -141,6 +141,7 @@ namespace AMDiS {
...
@@ -141,6 +141,7 @@ namespace AMDiS {
int
index
)
int
index
)
{
{
FUNCNAME
(
"RefinementManager3d::fillPatchConnectivity"
);
FUNCNAME
(
"RefinementManager3d::fillPatchConnectivity"
);
Element
*
el
=
ref_list
->
getElement
(
index
),
*
neigh
;
Element
*
el
=
ref_list
->
getElement
(
index
),
*
neigh
;
int
el_type
=
ref_list
->
getType
(
index
);
int
el_type
=
ref_list
->
getType
(
index
);
int
n_type
=
0
;
int
n_type
=
0
;
...
@@ -221,7 +222,7 @@ namespace AMDiS {
...
@@ -221,7 +222,7 @@ namespace AMDiS {
node1
=
mesh
->
getNode
(
FACE
)
+
j_neigh
;
node1
=
mesh
->
getNode
(
FACE
)
+
j_neigh
;
TEST_EXIT_DBG
(
neigh
->
getChild
(
j
)
->
getDOF
(
node1
))
TEST_EXIT_DBG
(
neigh
->
getChild
(
j
)
->
getDOF
(
node1
))
(
"
n
o
dof
on neighbour %d at node %d
\n
"
,
(
"
N
o
DOF
on neighbour %d at node %d
!
\n
"
,
neigh
->
getChild
(
j
)
->
getIndex
(),
node1
);
neigh
->
getChild
(
j
)
->
getIndex
(),
node1
);
(
const_cast
<
Element
*>
(
el
->
getChild
(
i
)))
->
(
const_cast
<
Element
*>
(
el
->
getChild
(
i
)))
->
...
@@ -394,7 +395,7 @@ namespace AMDiS {
...
@@ -394,7 +395,7 @@ namespace AMDiS {
dynamic_cast
<
Tetrahedron
*>
(
const_cast
<
Element
*>
((
*
el_info
)
->
getElement
()));
dynamic_cast
<
Tetrahedron
*>
(
const_cast
<
Element
*>
((
*
el_info
)
->
getElement
()));
if
((
*
el_info
)
->
getNeighbour
(
3
-
dir
)
==
NULL
)
if
((
*
el_info
)
->
getNeighbour
(
3
-
dir
)
==
NULL
)
return
1
;
return
1
;
int
opp_v
=
(
*
el_info
)
->
getOppVertex
(
3
-
dir
);
int
opp_v
=
(
*
el_info
)
->
getOppVertex
(
3
-
dir
);
ElInfo
*
neigh_info
=
stack
->
traverseNeighbour3d
((
*
el_info
),
3
-
dir
);
ElInfo
*
neigh_info
=
stack
->
traverseNeighbour3d
((
*
el_info
),
3
-
dir
);
...
@@ -528,24 +529,26 @@ namespace AMDiS {
...
@@ -528,24 +529,26 @@ namespace AMDiS {
break
;
break
;
}
}
}
}
if
(
neigh
==
el
)
{
if
(
neigh
==
el
)
{
(
*
el_info
)
=
neigh_info
;
(
*
el_info
)
=
neigh_info
;
return
0
;
return
0
;
}
}
/****************************************************************************/
/****************************************************************************/
/* the domain's boundary is reached; loop back to the starting el */
/* the domain's boundary is reached; loop back to the starting el */
/****************************************************************************/
/****************************************************************************/
i
=
*
n_neigh
-
1
;
i
=
*
n_neigh
-
1
;
opp_v
=
refineList
->
getOppVertex
(
i
,
0
);
opp_v
=
refineList
->
getOppVertex
(
i
,
0
);
do
{
do
{
TEST_EXIT_DBG
(
neigh_info
->
getNeighbour
(
opp_v
)
&&
i
>
0
)
TEST_EXIT_DBG
(
neigh_info
->
getNeighbour
(
opp_v
)
&&
i
>
0
)
(
"
w
hile looping back domains boundary was reached or i == 0
\n
"
);
(
"
W
hile looping back domains boundary was reached or i == 0
\n
"
);
opp_v
=
refineList
->
getOppVertex
(
i
--
,
0
);
opp_v
=
refineList
->
getOppVertex
(
i
--
,
0
);
neigh_info
=
stack
->
traverseNeighbour3d
(
neigh_info
,
opp_v
);
neigh_info
=
stack
->
traverseNeighbour3d
(
neigh_info
,
opp_v
);
}
while
(
neigh_info
->
getElement
()
!=
el
);
}
while
(
neigh_info
->
getElement
()
!=
el
);
(
*
el_info
)
=
neigh_info
;
(
*
el_info
)
=
neigh_info
;
return
1
;
return
1
;
...
@@ -555,6 +558,7 @@ namespace AMDiS {
...
@@ -555,6 +558,7 @@ namespace AMDiS {
ElInfo
*
RefinementManager3d
::
refineFunction
(
ElInfo
*
el_info
)
ElInfo
*
RefinementManager3d
::
refineFunction
(
ElInfo
*
el_info
)
{
{
FUNCNAME
(
"RefinementManager3d::refineFunction()"
);
FUNCNAME
(
"RefinementManager3d::refineFunction()"
);
int
bound
=
false
;
int
bound
=
false
;
DegreeOfFreedom
*
edge
[
2
];
DegreeOfFreedom
*
edge
[
2
];
...
@@ -618,7 +622,7 @@ namespace AMDiS {
...
@@ -618,7 +622,7 @@ namespace AMDiS {
std
::
map
<
int
,
VertexVector
*>::
iterator
it
;
std
::
map
<
int
,
VertexVector
*>::
iterator
it
;
std
::
map
<
int
,
VertexVector
*>::
iterator
end
=
mesh
->
getPeriodicAssociations
().
end
();
std
::
map
<
int
,
VertexVector
*>::
iterator
end
=
mesh
->
getPeriodicAssociations
().
end
();
while
(
edge
[
0
]
!=
NULL
)
{
while
(
edge
[
0
]
!=
NULL
)
{
periodicList
=
ref_list
->
periodicSplit
(
edge
,
periodicList
=
ref_list
->
periodicSplit
(
edge
,
next_edge
,
next_edge
,
&
n_neigh
,
&
n_neigh
,
...
@@ -635,13 +639,12 @@ namespace AMDiS {
...
@@ -635,13 +639,12 @@ namespace AMDiS {
for
(
it
=
mesh
->
getPeriodicAssociations
().
begin
();
it
!=
end
;
++
it
)
{
for
(
it
=
mesh
->
getPeriodicAssociations
().
begin
();
it
!=
end
;
++
it
)
{
if
(
it
->
second
)
{
if
(
it
->
second
)
{
if
(((
*
(
it
->
second
))[
edge
[
0
][
0
]]
==
last_edge
[
0
][
0
]
&&
if
(((
*
(
it
->
second
))[
edge
[
0
][
0
]]
==
last_edge
[
0
][
0
]
&&
(
*
(
it
->
second
))[
edge
[
1
][
0
]]
==
last_edge
[
1
][
0
])
||
(
*
(
it
->
second
))[
edge
[
1
][
0
]]
==
last_edge
[
1
][
0
])
||
((
*
(
it
->
second
))[
edge
[
0
][
0
]]
==
last_edge
[
1
][
0
]
&&
((
*
(
it
->
second
))[
edge
[
0
][
0
]]
==
last_edge
[
1
][
0
]
&&
(
*
(
it
->
second
))[
edge
[
1
][
0
]]
==
last_edge
[
0
][
0
]))
(
*
(
it
->
second
))[
edge
[
1
][
0
]]
==
last_edge
[
0
][
0
]))
{
{
(
*
(
it
->
second
))[
lastNewDOF
]
=
newDOF
;
(
*
(
it
->
second
))[
lastNewDOF
]
=
newDOF
;
(
*
(
it
->
second
))[
newDOF
]
=
lastNewDOF
;
(
*
(
it
->
second
))[
newDOF
]
=
lastNewDOF
;
}
}
}
}
}
}
}
}
...
@@ -658,13 +661,12 @@ namespace AMDiS {
...
@@ -658,13 +661,12 @@ namespace AMDiS {
for
(
it
=
mesh
->
getPeriodicAssociations
().
begin
();
it
!=
end
;
++
it
)
{
for
(
it
=
mesh
->
getPeriodicAssociations
().
begin
();
it
!=
end
;
++
it
)
{
if
(
it
->
second
)
{
if
(
it
->
second
)
{
if
(((
*
(
it
->
second
))[
first_edge
[
0
][
0
]]
==
last_edge
[
0
][
0
]
&&
if
(((
*
(
it
->
second
))[
first_edge
[
0
][
0
]]
==
last_edge
[
0
][
0
]
&&
(
*
(
it
->
second
))[
first_edge
[
1
][
0
]]
==
last_edge
[
1
][
0
])
||
(
*
(
it
->
second
))[
first_edge
[
1
][
0
]]
==
last_edge
[
1
][
0
])
||
((
*
(
it
->
second
))[
first_edge
[
0
][
0
]]
==
last_edge
[
1
][
0
]
&&
((
*
(
it
->
second
))[
first_edge
[
0
][
0
]]
==
last_edge
[
1
][
0
]
&&
(
*
(
it
->
second
))[
first_edge
[
1
][
0
]]
==
last_edge
[
0
][
0
]))
(
*
(
it
->
second
))[
first_edge
[
1
][
0
]]
==
last_edge
[
0
][
0
]))
{
{
(
*
(
it
->
second
))[
lastNewDOF
]
=
firstNewDOF
;
(
*
(
it
->
second
))[
lastNewDOF
]
=
firstNewDOF
;
(
*
(
it
->
second
))[
firstNewDOF
]
=
lastNewDOF
;
(
*
(
it
->
second
))[
firstNewDOF
]
=
lastNewDOF
;
}
}
}
}
}
}
}
}
...
@@ -679,7 +681,7 @@ namespace AMDiS {
...
@@ -679,7 +681,7 @@ namespace AMDiS {
delete
ref_list
;
delete
ref_list
;
return
(
el_info
)
;
return
el_info
;
}
}
}
}
AMDiS/src/Traverse.cc
View file @
cbc573e3
...
@@ -487,11 +487,10 @@ namespace AMDiS {
...
@@ -487,11 +487,10 @@ namespace AMDiS {
int
i
=
1
-
neighbour
;
int
i
=
1
-
neighbour
;
elinfo_stack
[
stack_used
+
1
]
->
fillElInfo
(
i
,
elinfo_stack
[
stack_used
]);
elinfo_stack
[
stack_used
+
1
]
->
fillElInfo
(
i
,
elinfo_stack
[
stack_used
]);
if
(
traverse_fill_flag
.
isSet
(
Mesh
::
CALL_REVERSE_MODE
))
if
(
traverse_fill_flag
.
isSet
(
Mesh
::
CALL_REVERSE_MODE
))
info_stack
[
stack_used
]
=
(
i
==
0
?
2
:
1
);
info_stack
[
stack_used
]
=
(
i
==
0
?
2
:
1
);
else
else
info_stack
[
stack_used
]
=
i
+
1
;
info_stack
[
stack_used
]
=
i
+
1
;
stack_used
++
;
stack_used
++
;
info_stack
[
stack_used
]
=
0
;
info_stack
[
stack_used
]
=
0
;
neighbour
=
3
;
neighbour
=
3
;
...
@@ -501,13 +500,6 @@ namespace AMDiS {
...
@@ -501,13 +500,6 @@ namespace AMDiS {
/* save information about current element and its position in the tree */
/* save information about current element and its position in the tree */
save_traverse_mel
=
traverse_mel
;
save_traverse_mel
=
traverse_mel
;
save_stack_used
=
stack_used
;
save_stack_used
=
stack_used
;
for
(
int
i
=
stack_used
;
i
<=
save_stack_used
;
i
++
)
{
save_info_stack
[
i
]
=
info_stack
[
i
];
*
(
save_elinfo_stack
[
i
])
=
*
(
elinfo_stack
[
i
]);
}
ElInfo
*
old_elinfo
=
save_elinfo_stack
[
save_stack_used
];
int
opp_vertex
=
old_elinfo
->
getOppVertex
(
neighbour
);
// === First phase (see 2D). ===
// === First phase (see 2D). ===
...
@@ -533,6 +525,13 @@ namespace AMDiS {
...
@@ -533,6 +525,13 @@ namespace AMDiS {
TEST_EXIT_DBG
(
nb
>=
0
)(
"invalid coarse_nb %d
\n
"
,
nb
);
TEST_EXIT_DBG
(
nb
>=
0
)(
"invalid coarse_nb %d
\n
"
,
nb
);
}
}
for
(
int
i
=
stack_used
;
i
<=
save_stack_used
;
i
++
)
{
save_info_stack
[
i
]
=
info_stack
[
i
];
*
(
save_elinfo_stack
[
i
])
=
*
(
elinfo_stack
[
i
]);
}
ElInfo
*
old_elinfo
=
save_elinfo_stack
[
save_stack_used
];
int
opp_vertex
=
old_elinfo
->
getOppVertex
(
neighbour
);
if
(
nb
>=
0
)
{
if
(
nb
>=
0
)
{
// Go to macro element neighbour.
// Go to macro element neighbour.
...
...
AMDiS/src/parallel/MeshDistributor.cc
View file @
cbc573e3
...
@@ -152,7 +152,7 @@ namespace AMDiS {
...
@@ -152,7 +152,7 @@ namespace AMDiS {
// === Create periodic dof mapping, if there are periodic boundaries. ===
// === Create periodic dof mapping, if there are periodic boundaries. ===
createPeriodicMap
();
createPeriodicMap
();
// === Global refinements. ===
// === Global refinements. ===
...
...
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