Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Backofen, Rainer
amdis
Commits
566d2c61
Commit
566d2c61
authored
Jan 16, 2012
by
Thomas Witkowski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First update of parallel AMDiS with mixed finite elements. Not tested, and there ARE BUGS.
parent
15d34568
Changes
34
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
943 additions
and
677 deletions
+943
-677
AMDiS/src/DOFAdmin.h
AMDiS/src/DOFAdmin.h
+1
-1
AMDiS/src/DOFMatrix.h
AMDiS/src/DOFMatrix.h
+4
-1
AMDiS/src/Debug.cc
AMDiS/src/Debug.cc
+14
-10
AMDiS/src/Debug.h
AMDiS/src/Debug.h
+18
-10
AMDiS/src/Element.cc
AMDiS/src/Element.cc
+1
-1
AMDiS/src/Element.h
AMDiS/src/Element.h
+3
-3
AMDiS/src/ElementDofIterator.cc
AMDiS/src/ElementDofIterator.cc
+17
-14
AMDiS/src/ElementDofIterator.h
AMDiS/src/ElementDofIterator.h
+27
-22
AMDiS/src/Line.h
AMDiS/src/Line.h
+2
-2
AMDiS/src/Mesh.cc
AMDiS/src/Mesh.cc
+23
-13
AMDiS/src/Mesh.h
AMDiS/src/Mesh.h
+5
-5
AMDiS/src/ProblemStat.h
AMDiS/src/ProblemStat.h
+1
-1
AMDiS/src/SecondOrderTerm.cc
AMDiS/src/SecondOrderTerm.cc
+2
-1
AMDiS/src/Tetrahedron.cc
AMDiS/src/Tetrahedron.cc
+4
-4
AMDiS/src/Tetrahedron.h
AMDiS/src/Tetrahedron.h
+4
-4
AMDiS/src/Triangle.cc
AMDiS/src/Triangle.cc
+4
-4
AMDiS/src/Triangle.h
AMDiS/src/Triangle.h
+2
-2
AMDiS/src/io/DataCollector.hh
AMDiS/src/io/DataCollector.hh
+1
-1
AMDiS/src/io/VtkVectorWriter.hh
AMDiS/src/io/VtkVectorWriter.hh
+1
-1
AMDiS/src/parallel/ElementObjectData.cc
AMDiS/src/parallel/ElementObjectData.cc
+16
-12
AMDiS/src/parallel/ElementObjectData.h
AMDiS/src/parallel/ElementObjectData.h
+22
-16
AMDiS/src/parallel/InteriorBoundary.cc
AMDiS/src/parallel/InteriorBoundary.cc
+1
-1
AMDiS/src/parallel/InteriorBoundary.h
AMDiS/src/parallel/InteriorBoundary.h
+1
-1
AMDiS/src/parallel/MeshDistributor.cc
AMDiS/src/parallel/MeshDistributor.cc
+350
-224
AMDiS/src/parallel/MeshDistributor.h
AMDiS/src/parallel/MeshDistributor.h
+110
-78
AMDiS/src/parallel/MeshManipulation.cc
AMDiS/src/parallel/MeshManipulation.cc
+8
-8
AMDiS/src/parallel/MeshManipulation.h
AMDiS/src/parallel/MeshManipulation.h
+4
-4
AMDiS/src/parallel/ParallelDebug.cc
AMDiS/src/parallel/ParallelDebug.cc
+75
-57
AMDiS/src/parallel/ParallelDebug.h
AMDiS/src/parallel/ParallelDebug.h
+3
-3
AMDiS/src/parallel/ParallelMapper.h
AMDiS/src/parallel/ParallelMapper.h
+45
-39
AMDiS/src/parallel/PetscSolverFeti.cc
AMDiS/src/parallel/PetscSolverFeti.cc
+65
-57
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalBlockMatrix.cc
+16
-9
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
AMDiS/src/parallel/PetscSolverGlobalMatrix.cc
+44
-31
AMDiS/src/parallel/PetscSolverSchur.cc
AMDiS/src/parallel/PetscSolverSchur.cc
+49
-37
No files found.
AMDiS/src/DOFAdmin.h
View file @
566d2c61
...
@@ -150,7 +150,7 @@ namespace AMDiS {
...
@@ -150,7 +150,7 @@ namespace AMDiS {
return
name
;
return
name
;
}
}
/// Returns \ref nDof[i], i.e., the number of
dof
s for the position i.
/// Returns \ref nDof[i], i.e., the number of
DOF
s for the position i.
inline
const
int
getNumberOfDofs
(
int
i
)
const
inline
const
int
getNumberOfDofs
(
int
i
)
const
{
{
return
nDof
[
i
];
return
nDof
[
i
];
...
...
AMDiS/src/DOFMatrix.h
View file @
566d2c61
...
@@ -492,7 +492,10 @@ namespace AMDiS {
...
@@ -492,7 +492,10 @@ namespace AMDiS {
int
nnzPerRow
;
int
nnzPerRow
;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
std
::
map
<
DegreeOfFreedom
,
bool
>
*
rankDofs
;
/// Stores for the DOFs of the row FE spaces whether they are owned by the
/// rank or not. This is used to ensure that Dirichlet BC is handled
/// correctly in parallel computations.
std
::
map
<
DegreeOfFreedom
,
bool
>
*
rankDofs
;
#endif
#endif
/// Inserter object: implemented as pointer, allocated and deallocated as needed
/// Inserter object: implemented as pointer, allocated and deallocated as needed
...
...
AMDiS/src/Debug.cc
View file @
566d2c61
...
@@ -25,7 +25,8 @@ namespace AMDiS {
...
@@ -25,7 +25,8 @@ namespace AMDiS {
namespace
debug
{
namespace
debug
{
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
void
writeLocalElementDofs
(
int
rank
,
int
elIdx
,
FiniteElemSpace
*
feSpace
)
void
writeLocalElementDofs
(
int
rank
,
int
elIdx
,
const
FiniteElemSpace
*
feSpace
)
{
{
using
boost
::
lexical_cast
;
using
boost
::
lexical_cast
;
...
@@ -37,7 +38,8 @@ namespace AMDiS {
...
@@ -37,7 +38,8 @@ namespace AMDiS {
}
}
void
writeDofMesh
(
int
rank
,
DegreeOfFreedom
dof
,
FiniteElemSpace
*
feSpace
)
void
writeDofMesh
(
int
rank
,
DegreeOfFreedom
dof
,
const
FiniteElemSpace
*
feSpace
)
{
{
using
boost
::
lexical_cast
;
using
boost
::
lexical_cast
;
...
@@ -50,7 +52,7 @@ namespace AMDiS {
...
@@ -50,7 +52,7 @@ namespace AMDiS {
}
}
void
writeMesh
(
FiniteElemSpace
*
feSpace
,
int
rank
,
std
::
string
filename
)
void
writeMesh
(
const
FiniteElemSpace
*
feSpace
,
int
rank
,
std
::
string
filename
)
{
{
using
boost
::
lexical_cast
;
using
boost
::
lexical_cast
;
...
@@ -64,7 +66,7 @@ namespace AMDiS {
...
@@ -64,7 +66,7 @@ namespace AMDiS {
#endif
#endif
void
writeDofIndexMesh
(
FiniteElemSpace
*
feSpace
)
void
writeDofIndexMesh
(
const
FiniteElemSpace
*
feSpace
)
{
{
DOFVector
<
double
>
tmp
(
feSpace
,
"tmp"
);
DOFVector
<
double
>
tmp
(
feSpace
,
"tmp"
);
DOFIterator
<
double
>
it
(
&
tmp
,
USED_DOFS
);
DOFIterator
<
double
>
it
(
&
tmp
,
USED_DOFS
);
...
@@ -74,7 +76,7 @@ namespace AMDiS {
...
@@ -74,7 +76,7 @@ namespace AMDiS {
}
}
void
colorEdgeInMesh
(
FiniteElemSpace
*
feSpace
,
void
colorEdgeInMesh
(
const
FiniteElemSpace
*
feSpace
,
Element
*
el
,
Element
*
el
,
int
localEdgeNo
,
int
localEdgeNo
,
std
::
string
filename
)
std
::
string
filename
)
...
@@ -190,7 +192,8 @@ namespace AMDiS {
...
@@ -190,7 +192,8 @@ namespace AMDiS {
}
}
Element
*
getDofIndexElement
(
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
)
Element
*
getDofIndexElement
(
const
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
)
{
{
const
BasisFunction
*
basFcts
=
feSpace
->
getBasisFcts
();
const
BasisFunction
*
basFcts
=
feSpace
->
getBasisFcts
();
int
nBasFcts
=
basFcts
->
getNumber
();
int
nBasFcts
=
basFcts
->
getNumber
();
...
@@ -322,7 +325,7 @@ namespace AMDiS {
...
@@ -322,7 +325,7 @@ namespace AMDiS {
}
}
void
printInfoByDof
(
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
)
void
printInfoByDof
(
const
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
)
{
{
FUNCNAME
(
"debug::printInfoByDof()"
);
FUNCNAME
(
"debug::printInfoByDof()"
);
...
@@ -387,7 +390,7 @@ namespace AMDiS {
...
@@ -387,7 +390,7 @@ namespace AMDiS {
}
}
void
printAllDofCoords
(
FiniteElemSpace
*
feSpace
)
void
printAllDofCoords
(
const
FiniteElemSpace
*
feSpace
)
{
{
FUNCNAME
(
"printAllDofCoords()"
);
FUNCNAME
(
"printAllDofCoords()"
);
...
@@ -405,7 +408,8 @@ namespace AMDiS {
...
@@ -405,7 +408,8 @@ namespace AMDiS {
}
}
void
getAllDofs
(
FiniteElemSpace
*
feSpace
,
std
::
set
<
const
DegreeOfFreedom
*>&
dofs
)
void
getAllDofs
(
const
FiniteElemSpace
*
feSpace
,
std
::
set
<
const
DegreeOfFreedom
*>&
dofs
)
{
{
FUNCNAME
(
"getAllDofs()"
);
FUNCNAME
(
"getAllDofs()"
);
...
@@ -793,7 +797,7 @@ namespace AMDiS {
...
@@ -793,7 +797,7 @@ namespace AMDiS {
}
}
void
testDofsByCoords
(
FiniteElemSpace
*
feSpace
,
void
testDofsByCoords
(
const
FiniteElemSpace
*
feSpace
,
DofContainer
&
dofs0
,
DofContainer
&
dofs1
)
DofContainer
&
dofs0
,
DofContainer
&
dofs1
)
{
{
FUNCNAME
(
"debug::testDofsByCoords()"
);
FUNCNAME
(
"debug::testDofsByCoords()"
);
...
...
AMDiS/src/Debug.h
View file @
566d2c61
...
@@ -41,9 +41,13 @@ namespace AMDiS {
...
@@ -41,9 +41,13 @@ namespace AMDiS {
typedef
std
::
map
<
int
,
DofContainer
>
ElementIdxToDofs
;
typedef
std
::
map
<
int
,
DofContainer
>
ElementIdxToDofs
;
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS
void
writeLocalElementDofs
(
int
rank
,
int
elIdx
,
FiniteElemSpace
*
feSpace
);
void
writeLocalElementDofs
(
int
rank
,
int
elIdx
,
const
FiniteElemSpace
*
feSpace
);
void
writeMesh
(
FiniteElemSpace
*
feSpace
,
int
rank
,
std
::
string
filename
);
void
writeMesh
(
const
FiniteElemSpace
*
feSpace
,
int
rank
,
std
::
string
filename
);
/** \brief
/** \brief
* Writes a vtu file with the mesh, where all DOFs are set to zero, and only
* Writes a vtu file with the mesh, where all DOFs are set to zero, and only
...
@@ -55,7 +59,9 @@ namespace AMDiS {
...
@@ -55,7 +59,9 @@ namespace AMDiS {
* \param[in] dof Defines the DOF, which value is set to one in the mesh file.
* \param[in] dof Defines the DOF, which value is set to one in the mesh file.
* \param[in] feSpace The FE space to be used.
* \param[in] feSpace The FE space to be used.
*/
*/
void
writeDofMesh
(
int
rank
,
DegreeOfFreedom
dof
,
FiniteElemSpace
*
feSpace
);
void
writeDofMesh
(
int
rank
,
DegreeOfFreedom
dof
,
const
FiniteElemSpace
*
feSpace
);
#endif
#endif
/** \brief
/** \brief
...
@@ -64,9 +70,9 @@ namespace AMDiS {
...
@@ -64,9 +70,9 @@ namespace AMDiS {
*
*
* \param[in] feSpace The FE space to be used.
* \param[in] feSpace The FE space to be used.
*/
*/
void
writeDofIndexMesh
(
FiniteElemSpace
*
feSpace
);
void
writeDofIndexMesh
(
const
FiniteElemSpace
*
feSpace
);
void
colorEdgeInMesh
(
FiniteElemSpace
*
feSpace
,
void
colorEdgeInMesh
(
const
FiniteElemSpace
*
feSpace
,
Element
*
el
,
Element
*
el
,
int
localEdgeNo
,
int
localEdgeNo
,
std
::
string
filename
);
std
::
string
filename
);
...
@@ -92,7 +98,8 @@ namespace AMDiS {
...
@@ -92,7 +98,8 @@ namespace AMDiS {
Mesh
*
mesh
,
Mesh
*
mesh
,
int
elIndex
);
int
elIndex
);
Element
*
getDofIndexElement
(
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
);
Element
*
getDofIndexElement
(
const
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
);
Element
*
getLevel0ParentElement
(
Mesh
*
mesh
,
Element
*
el
);
Element
*
getLevel0ParentElement
(
Mesh
*
mesh
,
Element
*
el
);
...
@@ -108,13 +115,14 @@ namespace AMDiS {
...
@@ -108,13 +115,14 @@ namespace AMDiS {
void
printElementCoords
(
const
FiniteElemSpace
*
feSpace
,
Element
*
el
);
void
printElementCoords
(
const
FiniteElemSpace
*
feSpace
,
Element
*
el
);
void
printInfoByDof
(
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
);
void
printInfoByDof
(
const
FiniteElemSpace
*
feSpace
,
DegreeOfFreedom
dof
);
void
printMatValuesStatistics
(
Matrix
<
DOFMatrix
*>
*
mat
);
void
printMatValuesStatistics
(
Matrix
<
DOFMatrix
*>
*
mat
);
void
printAllDofCoords
(
FiniteElemSpace
*
feSpace
);
void
printAllDofCoords
(
const
FiniteElemSpace
*
feSpace
);
void
getAllDofs
(
FiniteElemSpace
*
feSpace
,
std
::
set
<
const
DegreeOfFreedom
*>&
dofs
);
void
getAllDofs
(
const
FiniteElemSpace
*
feSpace
,
std
::
set
<
const
DegreeOfFreedom
*>&
dofs
);
/** \brief
/** \brief
* Creates a text file storing the value of a sparse matrix. Each line of the file
* Creates a text file storing the value of a sparse matrix. Each line of the file
...
@@ -200,7 +208,7 @@ namespace AMDiS {
...
@@ -200,7 +208,7 @@ namespace AMDiS {
const
DegreeOfFreedom
*
dof3
,
const
DegreeOfFreedom
*
dof3
,
DofContainer
&
vec
);
DofContainer
&
vec
);
void
testDofsByCoords
(
FiniteElemSpace
*
feSpace
,
void
testDofsByCoords
(
const
FiniteElemSpace
*
feSpace
,
DofContainer
&
dofs0
,
DofContainer
&
dofs1
);
DofContainer
&
dofs0
,
DofContainer
&
dofs1
);
}
}
...
...
AMDiS/src/Element.cc
View file @
566d2c61
...
@@ -625,7 +625,7 @@ namespace AMDiS {
...
@@ -625,7 +625,7 @@ namespace AMDiS {
}
}
void
Element
::
getAllDofs
(
FiniteElemSpace
*
feSpace
,
void
Element
::
getAllDofs
(
const
FiniteElemSpace
*
feSpace
,
BoundaryObject
bound
,
BoundaryObject
bound
,
DofContainer
&
dofs
)
DofContainer
&
dofs
)
{
{
...
...
AMDiS/src/Element.h
View file @
566d2c61
...
@@ -421,7 +421,7 @@ namespace AMDiS {
...
@@ -421,7 +421,7 @@ namespace AMDiS {
* which all vertex dofs are assembled.
* which all vertex dofs are assembled.
* \param[out] dofs List of dofs, where the result is stored.
* \param[out] dofs List of dofs, where the result is stored.
*/
*/
virtual
void
getNodeDofs
(
FiniteElemSpace
*
feSpace
,
virtual
void
getNodeDofs
(
const
FiniteElemSpace
*
feSpace
,
BoundaryObject
bound
,
BoundaryObject
bound
,
DofContainer
&
dofs
)
const
=
0
;
DofContainer
&
dofs
)
const
=
0
;
...
@@ -436,11 +436,11 @@ namespace AMDiS {
...
@@ -436,11 +436,11 @@ namespace AMDiS {
* all non vertex dofs are assembled.
* all non vertex dofs are assembled.
* \param[out] dofs All dofs are put to this dof list.
* \param[out] dofs All dofs are put to this dof list.
*/
*/
virtual
void
getHigherOrderDofs
(
FiniteElemSpace
*
feSpace
,
virtual
void
getHigherOrderDofs
(
const
FiniteElemSpace
*
feSpace
,
BoundaryObject
bound
,
BoundaryObject
bound
,
DofContainer
&
dofs
)
const
=
0
;
DofContainer
&
dofs
)
const
=
0
;
void
getAllDofs
(
FiniteElemSpace
*
feSpace
,
void
getAllDofs
(
const
FiniteElemSpace
*
feSpace
,
BoundaryObject
bound
,
BoundaryObject
bound
,
DofContainer
&
dofs
);
DofContainer
&
dofs
);
...
...
AMDiS/src/ElementDofIterator.cc
View file @
566d2c61
...
@@ -36,14 +36,15 @@ namespace AMDiS {
...
@@ -36,14 +36,15 @@ namespace AMDiS {
// Get geo index of vertices in the given dimension.
// Get geo index of vertices in the given dimension.
posIndex
=
INDEX_OF_DIM
(
pos
,
dim
);
posIndex
=
INDEX_OF_DIM
(
pos
,
dim
);
// Get number of
dof
s per vertex (should be one in all cases).
// Get number of
DOF
s per vertex (should be one in all cases).
nDofs
=
admin
->
getNumberOfDofs
(
posIndex
);
nDofs
=
admin
->
getNumberOfDofs
(
posIndex
);
TEST_EXIT_DBG
(
nDofs
!=
0
)(
"Mh, I've to think about this situation!
\n
"
);
TEST_EXIT_DBG
(
nDofs
!=
0
)(
"Mh, I've to think about this situation!
\n
"
);
// Calculate displacement. Is used if there is more than one dof admin on the mesh.
// Calculate displacement. Is used if there is more than one DOF admin
// on the mesh.
n0
=
admin
->
getNumberOfPreDofs
(
posIndex
);
n0
=
admin
->
getNumberOfPreDofs
(
posIndex
);
// Get first
dof
index position for vertices.
// Get first
DOF
index position for vertices.
node0
=
mesh
->
getNode
(
posIndex
);
node0
=
mesh
->
getNode
(
posIndex
);
// Get number of vertices in this dimension.
// Get number of vertices in this dimension.
nElements
=
Global
::
getGeo
(
posIndex
,
mesh
->
getDim
());
nElements
=
Global
::
getGeo
(
posIndex
,
mesh
->
getDim
());
...
@@ -55,11 +56,11 @@ namespace AMDiS {
...
@@ -55,11 +56,11 @@ namespace AMDiS {
bool
ElementDofIterator
::
next
()
bool
ElementDofIterator
::
next
()
{
{
// First iterate over the
dof
s of one element (vertex, edge, face).
// First iterate over the
DOF
s of one element (vertex, edge, face).
dofPos
++
;
dofPos
++
;
if
(
dofPos
>=
nDofs
)
{
if
(
dofPos
>=
nDofs
)
{
// We are finished with all
dof
s of on element. Go to the next one.
// We are finished with all
DOF
s of on element. Go to the next one.
dofPos
=
0
;
dofPos
=
0
;
elementPos
++
;
elementPos
++
;
...
@@ -72,33 +73,35 @@ namespace AMDiS {
...
@@ -72,33 +73,35 @@ namespace AMDiS {
return
false
;
return
false
;
// Increase position, i.e., go from vertices to edges to faces and search
// Increase position, i.e., go from vertices to edges to faces and search
// for the next position with
dof
s.
// for the next position with
DOF
s.
do
{
do
{
pos
++
;
pos
++
;
// Get geo index posistion.
// Get geo index posistion.
posIndex
=
INDEX_OF_DIM
(
pos
,
dim
);
posIndex
=
INDEX_OF_DIM
(
pos
,
dim
);
// Get number of
dof
s in this position.
// Get number of
DOF
s in this position.
nDofs
=
admin
->
getNumberOfDofs
(
posIndex
);
nDofs
=
admin
->
getNumberOfDofs
(
posIndex
);
}
while
(
nDofs
==
0
&&
pos
<
dim
);
}
while
(
nDofs
==
0
&&
pos
<
dim
);
if
(
nDofs
>
0
&&
pos
<=
dim
)
{
if
(
nDofs
>
0
&&
pos
<=
dim
)
{
// We have found on more position with
dof
s.
// We have found on more position with
DOF
s.
// Get number of elements in this position, i.e, the number of
vertices,.
// Get number of elements in this position, i.e, the number of
// edges and faces in the given dimension.
//
vertices,
edges and faces in the given dimension.
nElements
=
Global
::
getGeo
(
posIndex
,
dim
);
nElements
=
Global
::
getGeo
(
posIndex
,
dim
);
// Calculate displacement. Is used if there is more than one dof admin on the mesh.
// Calculate displacement. Is used if there is more than one DOF
// admin on the mesh.
n0
=
admin
->
getNumberOfPreDofs
(
posIndex
);
n0
=
admin
->
getNumberOfPreDofs
(
posIndex
);
// Get first
dof
index position for the geo index position.
// Get first
DOF
index position for the geo index position.
node0
=
mesh
->
getNode
(
posIndex
);
node0
=
mesh
->
getNode
(
posIndex
);
if
(
inOrder
)
if
(
inOrder
)
orderPosition
=
basisFcts
->
orderOfPositionIndices
(
element
,
posIndex
,
0
);
orderPosition
=
basisFcts
->
orderOfPositionIndices
(
element
,
posIndex
,
0
);
}
else
{
}
else
{
// That's all, we jave traversed all
dof
s of the mesh element.
// That's all, we jave traversed all
DOF
s of the mesh element.
return
false
;
return
false
;
}
}
...
...
AMDiS/src/ElementDofIterator.h
View file @
566d2c61
...
@@ -30,7 +30,7 @@
...
@@ -30,7 +30,7 @@
namespace
AMDiS
{
namespace
AMDiS
{
/** \brief
/** \brief
* This class implements an iterator to iterate over all
dof
s of one element
* This class implements an iterator to iterate over all
DOF
s of one element
* independet of dimension and the degree of basis functions.
* independet of dimension and the degree of basis functions.
*
*
* Should be used in the following way:
* Should be used in the following way:
...
@@ -57,12 +57,12 @@ namespace AMDiS {
...
@@ -57,12 +57,12 @@ namespace AMDiS {
/// Start a new traverse with the given element.
/// Start a new traverse with the given element.
void
reset
(
const
Element
*
el
);
void
reset
(
const
Element
*
el
);
/// Go to next
dof
. Returns false, if there is
dof
anymore.
/// Go to next
DOF
. Returns false, if there is
no DOF
anymore.
bool
next
();
bool
next
();
bool
nextStrict
();
bool
nextStrict
();
/// Returns the
dof
index of the current
dof
.
/// Returns the
DOF
index of the current
DOF
.
inline
DegreeOfFreedom
getDof
()
inline
DegreeOfFreedom
getDof
()
{
{
if
(
inOrder
)
if
(
inOrder
)
...
@@ -71,7 +71,7 @@ namespace AMDiS {
...
@@ -71,7 +71,7 @@ namespace AMDiS {
return
dofs
[
node0
+
elementPos
][
n0
+
dofPos
];
return
dofs
[
node0
+
elementPos
][
n0
+
dofPos
];
}
}
/// Returns a pointer to the current
dof
.
/// Returns a pointer to the current
DOF
.
inline
const
DegreeOfFreedom
*
getDofPtr
()
inline
const
DegreeOfFreedom
*
getDofPtr
()
{
{
if
(
inOrder
)
if
(
inOrder
)
...
@@ -80,13 +80,22 @@ namespace AMDiS {
...
@@ -80,13 +80,22 @@ namespace AMDiS {
return
&
dofs
[
node0
+
elementPos
][
n0
+
dofPos
];
return
&
dofs
[
node0
+
elementPos
][
n0
+
dofPos
];
}
}
/// Returns \ref pos, the current position (vertex, edge, face) of the traverse.
/// Returns a pointer to the starting position of the current DOF
/// array. Makes only sence, if \ref nextStrict() is used for traverse.
inline
const
DegreeOfFreedom
*
getStartDof
()
{
return
dofs
[
node0
+
elementPos
];
}
/// Returns \ref pos, the current position (vertex, edge, face) of
/// the traverse.
inline
int
getCurrentPos
()
inline
int
getCurrentPos
()
{
{
return
pos
;
return
pos
;
}
}
/// Returns \ref elementPos, the number of vertex, edge or face that is traversed.
/// Returns \ref elementPos, the number of vertex, edge or face that
/// is traversed.
inline
int
getCurrentElementPos
()
inline
int
getCurrentElementPos
()
{
{
return
elementPos
;
return
elementPos
;
...
@@ -99,12 +108,12 @@ namespace AMDiS {
...
@@ -99,12 +108,12 @@ namespace AMDiS {
protected:
protected:
/// The
dof
admin for which
dof
s should be traversed.
/// The
DOF
admin for which
DOF
s should be traversed.
const
DOFAdmin
*
admin
;
const
DOFAdmin
*
admin
;
const
BasisFunction
*
basisFcts
;
const
BasisFunction
*
basisFcts
;
/// Pointer to the
dof
s that should be traversed.
/// Pointer to the
DOF
s that should be traversed.
const
DegreeOfFreedom
**
dofs
;
const
DegreeOfFreedom
**
dofs
;
/// Mesh on which the element is defined.
/// Mesh on which the element is defined.
...
@@ -126,32 +135,28 @@ namespace AMDiS {
...
@@ -126,32 +135,28 @@ namespace AMDiS {
GeoIndex
posIndex
;
GeoIndex
posIndex
;
/** \brief
/** \brief
* Number of
dof
s at the current traverse position. Examples: independent of
* Number of
DOF
s at the current traverse position. Examples: independent of
* dimension and degree of basis functions there is only one
dof
per vertex.
* dimension and degree of basis functions there is only one
DOF
per vertex.
* But in 2
d
and with 3rd degree lagrange basis functions there are two
* But in 2
D
and with 3rd degree lagrange basis functions there are two
*
dof
s per edge.
*
DOF
s per edge.
*/
*/
int
nDofs
;
int
nDofs
;
/** \brief
/// Displacement of DOF indices. Used if more than one DOF admin is defined
* Displacement of dof indices. Used of more than one dof admin is defined
/// on the mesh.
* on the mesh.
*/
int
n0
;
int
n0
;
/// D
of
index of the first
dof
at this geo index position.
/// D
OF
index of the first
DOF
at this geo index position.
int
node0
;
int
node0
;
/** \brief
/// Number of elements in the current geo position. Examples: 3 vertices in
* Number of elements in the current geo position. Examples: 3 vertices in 2d,
/// 2d, 1 face in 2d, 4 faces in 3d, etc.
* 1 face in 2d, 4 faces in 3d, etc.
*/
int
nElements
;
int
nElements
;
/// Current element, i.e., ith vertex, edge or face, that is traversed.
/// Current element, i.e., ith vertex, edge or face, that is traversed.
int
elementPos
;
int
elementPos
;
/// Currrent
dof
that is traversed on the current element;
/// Currrent
DOF
that is traversed on the current element;
int
dofPos
;
int
dofPos
;
};
};
}
}
...
...
AMDiS/src/Line.h
View file @
566d2c61
...
@@ -173,13 +173,13 @@ namespace AMDiS {
...
@@ -173,13 +173,13 @@ namespace AMDiS {
return
"Line"
;
return
"Line"
;
}
}
void
getNodeDofs
(
FiniteElemSpace
*
,
BoundaryObject
,
DofContainer
&
)
const
void
getNodeDofs
(
const
FiniteElemSpace
*
,
BoundaryObject
,
DofContainer
&
)
const
{
{
FUNCNAME
(
"Line::getNodeDofs()"
);
FUNCNAME
(
"Line::getNodeDofs()"
);
ERROR_EXIT
(
"Not yet implemented!
\n
"
);
ERROR_EXIT
(
"Not yet implemented!
\n
"
);
}
}
void
getHigherOrderDofs
(
FiniteElemSpace
*
,
BoundaryObject
,
DofContainer
&
)
const
void
getHigherOrderDofs
(
const
FiniteElemSpace
*
,
BoundaryObject
,
DofContainer
&
)
const
{
{
FUNCNAME
(
"Line::getHigherOrderDofs()"
);
FUNCNAME
(
"Line::getHigherOrderDofs()"
);
ERROR_EXIT
(
"Not yet implemented!
\n
"
);
ERROR_EXIT
(
"Not yet implemented!
\n
"
);
...
...
AMDiS/src/Mesh.cc
View file @
566d2c61
...
@@ -271,21 +271,32 @@ namespace AMDiS {
...
@@ -271,21 +271,32 @@ namespace AMDiS {