Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Aland, Sebastian
amdis
Commits
50c856b0
Commit
50c856b0
authored
Apr 27, 2009
by
Thomas Witkowski
Browse files
Independent meshes for higher order lagrange finite elements.
parent
7b836281
Changes
13
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/BasisFunction.h
View file @
50c856b0
...
@@ -22,10 +22,6 @@
...
@@ -22,10 +22,6 @@
#ifndef AMDIS_BASISFUNCTION_H
#ifndef AMDIS_BASISFUNCTION_H
#define AMDIS_BASISFUNCTION_H
#define AMDIS_BASISFUNCTION_H
// ============================================================================
// ===== includes =============================================================
// ============================================================================
#include
<string>
#include
<string>
#include
"Global.h"
#include
"Global.h"
#include
"Boundary.h"
#include
"Boundary.h"
...
@@ -33,10 +29,6 @@
...
@@ -33,10 +29,6 @@
namespace
AMDiS
{
namespace
AMDiS
{
// ============================================================================
// ===== forward declarations =================================================
// ============================================================================
class
DOFAdmin
;
class
DOFAdmin
;
class
Element
;
class
Element
;
class
ElInfo
;
class
ElInfo
;
...
@@ -54,10 +46,6 @@ namespace AMDiS {
...
@@ -54,10 +46,6 @@ namespace AMDiS {
template
<
typename
T
>
class
VectorOfFixVecs
;
template
<
typename
T
>
class
VectorOfFixVecs
;
// ============================================================================
// ===== function interfaces===================================================
// ============================================================================
/** \brief
/** \brief
* Function interface for evaluating basis functions.
* Function interface for evaluating basis functions.
*/
*/
...
@@ -101,20 +89,11 @@ namespace AMDiS {
...
@@ -101,20 +89,11 @@ namespace AMDiS {
DimMat
<
double
>&
)
const
=
0
;
DimMat
<
double
>&
)
const
=
0
;
};
};
// ============================================================================
// ===== typedefs =============================================================
// ============================================================================
typedef
BasFctType
*
BFptr
;
typedef
BasFctType
*
BFptr
;
typedef
GrdBasFctType
*
GBFptr
;
typedef
GrdBasFctType
*
GBFptr
;
typedef
D2BasFctType
*
DBFptr
;
typedef
D2BasFctType
*
DBFptr
;
// ============================================================================
// ===== class BasisFunction ==================================================
// ============================================================================
/** \ingroup FEMSpace
/** \ingroup FEMSpace
* \brief
* \brief
* Base class for finite element basis functions. In order to build up a
* Base class for finite element basis functions. In order to build up a
...
...
AMDiS/src/DualTraverse.cc
View file @
50c856b0
...
@@ -176,9 +176,9 @@ namespace AMDiS {
...
@@ -176,9 +176,9 @@ namespace AMDiS {
}
}
if
(
elInfo1
==
elInfoSmall
)
{
if
(
elInfo1
==
elInfoSmall
)
{
stack1
.
getCoordsInElem
(
elInfo2
,
subCoordsMat
);
stack1
.
getCoordsInElem
(
elInfo2
,
basisFcts
,
subCoordsMat
);
}
else
{
}
else
{
stack2
.
getCoordsInElem
(
elInfo1
,
subCoordsMat
);
stack2
.
getCoordsInElem
(
elInfo1
,
basisFcts
,
subCoordsMat
);
}
}
elInfoSmall
->
setSubElemCoordsMat
(
subCoordsMat
);
elInfoSmall
->
setSubElemCoordsMat
(
subCoordsMat
);
...
...
AMDiS/src/DualTraverse.h
View file @
50c856b0
...
@@ -31,28 +31,20 @@ namespace AMDiS {
...
@@ -31,28 +31,20 @@ namespace AMDiS {
class
Mesh
;
class
Mesh
;
class
ElInfo
;
class
ElInfo
;
// ====================================================================
/// Parallel traversal of two meshes.
// === class DualTraverse =============================================
// ====================================================================
/** \brief
* Parallel traversal of two meshes.
*/
class
DualTraverse
class
DualTraverse
{
{
public:
public:
MEMORY_MANAGED
(
DualTraverse
);
MEMORY_MANAGED
(
DualTraverse
);
DualTraverse
()
DualTraverse
()
:
fillSubElemMat
(
false
)
:
fillSubElemMat
(
false
),
basisFcts
(
NULL
)
{}
{}
~
DualTraverse
()
~
DualTraverse
()
{}
{}
/** \brief
/// Start dual traversal
* Start dual traversal
*/
bool
traverseFirst
(
Mesh
*
mesh1
,
bool
traverseFirst
(
Mesh
*
mesh1
,
Mesh
*
mesh2
,
Mesh
*
mesh2
,
int
level1
,
int
level1
,
...
@@ -82,15 +74,16 @@ namespace AMDiS {
...
@@ -82,15 +74,16 @@ namespace AMDiS {
}
}
virtual
bool
skipEl1
(
ElInfo
*
elInfo
)
{
virtual
bool
skipEl1
(
ElInfo
*
elInfo
)
{
return
false
;
return
false
;
}
;
}
virtual
bool
skipEl2
(
ElInfo
*
elInfo
)
{
virtual
bool
skipEl2
(
ElInfo
*
elInfo
)
{
return
false
;
return
false
;
}
;
}
inline
void
setFillSubElemMat
(
bool
b
)
{
inline
void
setFillSubElemMat
(
bool
b
,
const
BasisFunction
*
fcts
)
{
fillSubElemMat
=
b
;
fillSubElemMat
=
b
;
basisFcts
=
fcts
;
}
}
protected:
protected:
...
@@ -109,14 +102,10 @@ namespace AMDiS {
...
@@ -109,14 +102,10 @@ namespace AMDiS {
ElInfo
*
elInfoLarge
);
ElInfo
*
elInfoLarge
);
protected:
protected:
/** \brief
/// Stack for mesh 1
* stack for mesh 1
*/
TraverseStack
stack1
;
TraverseStack
stack1
;
/** \brief
/// Stack for mesh 2
* stack for mesh 2
*/
TraverseStack
stack2
;
TraverseStack
stack2
;
/** \brief
/** \brief
...
@@ -125,34 +114,22 @@ namespace AMDiS {
...
@@ -125,34 +114,22 @@ namespace AMDiS {
*/
*/
double
rest
;
double
rest
;
/** \brief
/// true if element 1 should be incremented (set in prepareNextStep())
* true is element 1 should be incremented (set in prepareNextStep())
*/
bool
inc1
;
bool
inc1
;
/** \brief
/// true if element 2 should be incremented (set in prepareNextStep())
* true is element 2 should be incremented (set in prepareNextStep())
*/
bool
inc2
;
bool
inc2
;
/** \brief
/// for level traverse of mesh 1
* for level traverse of mesh 1
*/
int
level1_
;
int
level1_
;
/** \brief
/// for level traverse of mesh 2
* for level traverse of mesh 2
*/
int
level2_
;
int
level2_
;
/** \brief
/// for leaf element level traverse of mesh 1
* for leaf element level traverse of mesh 1
*/
bool
callLeafElLevel1_
;
bool
callLeafElLevel1_
;
/** \brief
/// for leaf element level traverse of mesh 2
* for leaf element level traverse of mesh 2
*/
bool
callLeafElLevel2_
;
bool
callLeafElLevel2_
;
/** \brief
/** \brief
...
@@ -161,6 +138,12 @@ namespace AMDiS {
...
@@ -161,6 +138,12 @@ namespace AMDiS {
* points defined on the larger element to the coordinates of the smaller element.
* points defined on the larger element to the coordinates of the smaller element.
*/
*/
bool
fillSubElemMat
;
bool
fillSubElemMat
;
/** \brief
* If \ref fillSubElemMat is set to true, the corresponding transformation
* matrices are computed. These depend on the basis functions that are used.
*/
const
BasisFunction
*
basisFcts
;
};
};
}
}
...
...
AMDiS/src/ElInfo.h
View file @
50c856b0
...
@@ -22,9 +22,6 @@
...
@@ -22,9 +22,6 @@
#ifndef AMDIS_ELINFO_H
#ifndef AMDIS_ELINFO_H
#define AMDIS_ELINFO_H
#define AMDIS_ELINFO_H
// ============================================================================
// ===== includes =============================================================
// ============================================================================
#include
"Flag.h"
#include
"Flag.h"
#include
"Boundary.h"
#include
"Boundary.h"
#include
"Global.h"
#include
"Global.h"
...
@@ -33,9 +30,6 @@
...
@@ -33,9 +30,6 @@
namespace
AMDiS
{
namespace
AMDiS
{
// ============================================================================
// ===== forward declarations =================================================
// ============================================================================
class
MacroElement
;
class
MacroElement
;
class
Mesh
;
class
Mesh
;
class
Element
;
class
Element
;
...
@@ -43,11 +37,6 @@ namespace AMDiS {
...
@@ -43,11 +37,6 @@ namespace AMDiS {
class
Projection
;
class
Projection
;
template
<
typename
ReturnType
,
typename
ArgumentType
>
class
AbstractFunction
;
template
<
typename
ReturnType
,
typename
ArgumentType
>
class
AbstractFunction
;
// ============================================================================
// ===== class ElInfo =========================================================
// ============================================================================
/** \ingroup Traverse
/** \ingroup Traverse
* \brief
* \brief
* An ElInfo object holds informations wich are not stored in the corresponding
* An ElInfo object holds informations wich are not stored in the corresponding
...
@@ -61,11 +50,8 @@ namespace AMDiS {
...
@@ -61,11 +50,8 @@ namespace AMDiS {
class
ElInfo
class
ElInfo
{
{
// ===== construtors, destructors =============================================
protected:
protected:
/** \brief
/// Protected constructor. Avoids instatiation of the basis class
* Protected constructor. Avoids instatiation of the basis class
*/
ElInfo
();
ElInfo
();
/** \brief
/** \brief
...
@@ -75,9 +61,7 @@ namespace AMDiS {
...
@@ -75,9 +61,7 @@ namespace AMDiS {
ElInfo
(
Mesh
*
mesh
);
ElInfo
(
Mesh
*
mesh
);
public:
public:
/** \brief
/// Virtual destructor because ElInfo is pure virtual.
* Virtual destructor because ElInfo is pure virtual.
*/
virtual
~
ElInfo
();
virtual
~
ElInfo
();
/** \brief
/** \brief
...
@@ -178,35 +162,25 @@ namespace AMDiS {
...
@@ -178,35 +162,25 @@ namespace AMDiS {
return
oppCoord_
[
i
];
return
oppCoord_
[
i
];
}
}
/** \brief
/// Get ElInfo's \ref boundary_[i]
* Get ElInfo's \ref boundary_[i]
*/
inline
BoundaryType
getBoundary
(
int
i
)
const
{
inline
BoundaryType
getBoundary
(
int
i
)
const
{
return
boundary_
[
i
];
return
boundary_
[
i
];
}
}
/** \brief
/// Get boundary type of i-th vertex/edge/face (pos).
* Get boundary type of i-th vertex/edge/face (pos).
*/
BoundaryType
getBoundary
(
GeoIndex
pos
,
int
i
);
BoundaryType
getBoundary
(
GeoIndex
pos
,
int
i
);
/** \brief
/// Get ElInfo's \ref neighbour_[i]
* Get ElInfo's \ref neighbour_[i]
*/
inline
Element
*
getNeighbour
(
int
i
)
const
{
inline
Element
*
getNeighbour
(
int
i
)
const
{
return
neighbour_
[
i
];
return
neighbour_
[
i
];
}
}
/** \brief
/// Get ElInfo's \ref neighbourCoord_[i]
* Get ElInfo's \ref neighbourCoord_[i]
*/
inline
FixVec
<
WorldVector
<
double
>
,
VERTEX
>
getNeighbourCoord
(
int
i
)
const
{
inline
FixVec
<
WorldVector
<
double
>
,
VERTEX
>
getNeighbourCoord
(
int
i
)
const
{
return
neighbourCoord_
[
i
];
return
neighbourCoord_
[
i
];
}
}
/** \brief
/// Get ElInfo's \ref oppVertex_[i]
* Get ElInfo's \ref oppVertex_[i]
*/
inline
unsigned
char
getOppVertex
(
int
i
)
const
{
inline
unsigned
char
getOppVertex
(
int
i
)
const
{
return
oppVertex_
[
i
];
return
oppVertex_
[
i
];
}
}
...
@@ -215,30 +189,22 @@ namespace AMDiS {
...
@@ -215,30 +189,22 @@ namespace AMDiS {
return
oppVertex_
[
i
];
return
oppVertex_
[
i
];
}
}
/** \brief
/// Get ElInfo's \ref det_
* Get ElInfo's \ref det_
*/
inline
double
getDet
()
const
{
inline
double
getDet
()
const
{
return
det_
;
return
det_
;
}
}
/** \brief
/// Returns \ref grdLambda
* Returns \ref grdLambda
*/
inline
const
DimVec
<
WorldVector
<
double
>
>&
getGrdLambda
()
const
{
inline
const
DimVec
<
WorldVector
<
double
>
>&
getGrdLambda
()
const
{
return
grdLambda
;
return
grdLambda
;
}
}
/** \brief
/// Returns \ref projection_[i]
* Returns \ref projection_[i]
*/
inline
Projection
*
getProjection
(
int
i
)
const
{
inline
Projection
*
getProjection
(
int
i
)
const
{
return
projection_
[
i
];
return
projection_
[
i
];
}
}
/** \brief
/// Returns \ref parametric_
* Returns \ref parametric_
*/
inline
bool
getParametric
()
{
inline
bool
getParametric
()
{
return
parametric_
;
return
parametric_
;
}
}
...
@@ -253,92 +219,66 @@ namespace AMDiS {
...
@@ -253,92 +219,66 @@ namespace AMDiS {
/** \} */
/** \} */
// ===== setting-methods ======================================================
/** \name setting methods
/** \name setting methods
* \{
* \{
*/
*/
/** \brief
/// Set ElInfo's \ref mesh_
* Set ElInfo's \ref mesh_
*/
inline
void
setMesh
(
Mesh
*
aMesh
)
{
inline
void
setMesh
(
Mesh
*
aMesh
)
{
mesh_
=
aMesh
;
mesh_
=
aMesh
;
}
}
/** \brief
/// Set ElInfo's \ref macroElement_
* Set ElInfo's \ref macroElement_
*/
inline
void
setMacroElement
(
MacroElement
*
mel
)
{
inline
void
setMacroElement
(
MacroElement
*
mel
)
{
macroElement_
=
mel
;
macroElement_
=
mel
;
}
}
/** \brief
/// Set ElInfo's \ref element
* Set ElInfo's \ref element
*/
inline
void
setElement
(
Element
*
elem
)
{
inline
void
setElement
(
Element
*
elem
)
{
element_
=
elem
;
element_
=
elem
;
}
}
/** \brief
/// Set ElInfo's \ref parent_
* Set ElInfo's \ref parent_
*/
inline
void
setParent
(
Element
*
elem
)
{
inline
void
setParent
(
Element
*
elem
)
{
parent_
=
elem
;
parent_
=
elem
;
}
}
/** \brief
/// Set ElInfo's \ref fillFlag_
* Set ElInfo's \ref fillFlag_
*/
inline
void
setFillFlag
(
Flag
flag
)
{
inline
void
setFillFlag
(
Flag
flag
)
{
fillFlag_
=
flag
;
fillFlag_
=
flag
;
}
}
/** \brief
/// Sets ElInfo's \ref coord_[i].
* Sets ElInfo's \ref coord_[i].
*/
inline
void
setCoord
(
int
i
,
WorldVector
<
double
>&
coord
)
{
inline
void
setCoord
(
int
i
,
WorldVector
<
double
>&
coord
)
{
coord_
[
i
]
=
coord
;
coord_
[
i
]
=
coord
;
}
}
/** \brief
/// Sets ElInfo's \ref coord.
* Sets ElInfo's \ref coord.
*/
inline
void
setCoords
(
FixVec
<
WorldVector
<
double
>
,
VERTEX
>&
coords
)
{
inline
void
setCoords
(
FixVec
<
WorldVector
<
double
>
,
VERTEX
>&
coords
)
{
coord_
=
coords
;
coord_
=
coords
;
}
}
/** \brief
/// Set ElInfo's \ref level
* Set ElInfo's \ref level
*/
inline
void
setLevel
(
int
l
)
{
inline
void
setLevel
(
int
l
)
{
level
=
l
;
level
=
l
;
}
}
/** \brief
/// Set ElInfo's \ref boundary_[i]
* Set ElInfo's \ref boundary_[i]
*/
inline
void
setBoundary
(
int
i
,
BoundaryType
t
)
{
inline
void
setBoundary
(
int
i
,
BoundaryType
t
)
{
boundary_
[
i
]
=
newBound
(
boundary_
[
i
],
t
);
boundary_
[
i
]
=
newBound
(
boundary_
[
i
],
t
);
}
}
/** \brief
/// Set \ref projection_[i] = p
* Set \ref projection_[i] = p
*/
inline
void
setProjection
(
int
i
,
Projection
*
p
)
{
inline
void
setProjection
(
int
i
,
Projection
*
p
)
{
projection_
[
i
]
=
p
;
projection_
[
i
]
=
p
;
}
}
/** \brief
/// Set \ref det_ = d
* Set \ref det_ = d
*/
inline
void
setDet
(
double
d
)
{
inline
void
setDet
(
double
d
)
{
det_
=
d
;
det_
=
d
;
}
}
/** \brief
/// Set \ref parametric_ = param
* Set \ref parametric_ = param
*/
inline
void
setParametric
(
bool
param
)
{
inline
void
setParametric
(
bool
param
)
{
parametric_
=
param
;
parametric_
=
param
;
}
}
...
@@ -353,8 +293,6 @@ namespace AMDiS {
...
@@ -353,8 +293,6 @@ namespace AMDiS {
/** \} */
/** \} */
// ===== other public methods =================================================
/** \brief
/** \brief
* Returns the absolute value of the determinant of the affine linear
* Returns the absolute value of the determinant of the affine linear
...
@@ -443,10 +381,12 @@ namespace AMDiS {
...
@@ -443,10 +381,12 @@ namespace AMDiS {
return
(
0.0
);
return
(
0.0
);
}
}
virtual
void
getRefSimplexCoords
(
DimMat
<
double
>
*
coords
)
const
=
0
;
virtual
void
getRefSimplexCoords
(
const
BasisFunction
*
basisFcts
,
DimMat
<
double
>
*
coords
)
const
=
0
;
virtual
void
getSubElementCoords
(
DimMat
<
double
>
*
coords
,
virtual
void
getSubElementCoords
(
const
BasisFunction
*
basisFcts
,
int
iChild
)
const
=
0
;
int
iChild
,
DimMat
<
double
>
*
coords
)
const
=
0
;
protected:
protected:
/// Pointer to the current mesh
/// Pointer to the current mesh
...
...
AMDiS/src/ElInfo1d.cc
View file @
50c856b0
...
@@ -30,9 +30,8 @@ namespace AMDiS {
...
@@ -30,9 +30,8 @@ namespace AMDiS {
if
(
fillFlag_
.
isSet
(
Mesh
::
FILL_COORDS
)
||
fillFlag_
.
isSet
(
Mesh
::
FILL_DET
)
||
if
(
fillFlag_
.
isSet
(
Mesh
::
FILL_COORDS
)
||
fillFlag_
.
isSet
(
Mesh
::
FILL_DET
)
||
fillFlag_
.
isSet
(
Mesh
::
FILL_GRD_LAMBDA
))
{
fillFlag_
.
isSet
(
Mesh
::
FILL_GRD_LAMBDA
))
{
for
(
int
i
=
0
;
i
<
vertices
;
i
++
)
{
for
(
int
i
=
0
;
i
<
vertices
;
i
++
)
coord_
[
i
]
=
mel
->
coord
[
i
];
coord_
[
i
]
=
mel
->
coord
[
i
];
}
}
}
if
(
fillFlag_
.
isSet
(
Mesh
::
FILL_NEIGH
)
||
fillFlag_
.
isSet
(
Mesh
::
FILL_OPP_COORDS
))
{
if
(
fillFlag_
.
isSet
(
Mesh
::
FILL_NEIGH
)
||
fillFlag_
.
isSet
(
Mesh
::
FILL_OPP_COORDS
))
{
...
@@ -72,9 +71,8 @@ namespace AMDiS {
...
@@ -72,9 +71,8 @@ namespace AMDiS {
for
(
int
i
=
0
;
i
<
vertices
;
i
++
)
for
(
int
i
=
0
;
i
<
vertices
;
i
++
)