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
Backofen, Rainer
amdis
Commits
c3474ca2
Commit
c3474ca2
authored
May 07, 2009
by
Thomas Witkowski
Browse files
Some source code refactoring, no real changes.
parent
ee319d21
Changes
38
Hide whitespace changes
Inline
Side-by-side
AMDiS/src/AMDiS_fwd.h
View file @
c3474ca2
...
...
@@ -33,6 +33,8 @@ namespace AMDiS {
class
CoarseningManager
;
class
DiagonalPreconditioner
;
class
DOFAdmin
;
class
DOFContainer
;
class
DOFIndexedBase
;
class
DOFMatrix
;
class
Element
;
class
ElementMatrix
;
...
...
@@ -63,6 +65,7 @@ namespace AMDiS {
class
RefinementManager
;
class
RobinBC
;
class
SystemVector
;
class
VertexInfo
;
class
VertexVector
;
template
<
typename
ReturnType
,
typename
ArgumentType
>
class
AbstractFunction
;
...
...
AMDiS/src/AbstractFunction.h
View file @
c3474ca2
...
...
@@ -23,7 +23,6 @@
#define AMDIS_ABSTRACTFUNCTION_H
#include "Global.h"
#include "MemoryManager.h"
namespace
AMDiS
{
...
...
AMDiS/src/AdaptInfo.h
View file @
c3474ca2
...
...
@@ -22,7 +22,6 @@
#ifndef AMDIS_ADAPTINFO_H
#define AMDIS_ADAPTINFO_H
#include "MemoryManager.h"
#include "MatrixVector.h"
#include "Parameters.h"
#include "Serializable.h"
...
...
AMDiS/src/AdaptInstationary.h
View file @
c3474ca2
...
...
@@ -26,7 +26,6 @@
#include <ctime>
#include <queue>
#include "Flag.h"
#include "MemoryManager.h"
#include "AdaptInfo.h"
#include "AdaptBase.h"
#include "AMDiS_fwd.h"
...
...
AMDiS/src/AdaptStationary.h
View file @
c3474ca2
...
...
@@ -31,7 +31,6 @@
#include <string>
#include "Flag.h"
#include "MemoryManager.h"
#include "AdaptInfo.h"
#include "AdaptBase.h"
#include "AMDiS_fwd.h"
...
...
AMDiS/src/Assembler.h
View file @
c3474ca2
...
...
@@ -32,7 +32,6 @@
#include <vector>
#include "FixVec.h"
#include "MemoryManager.h"
#include "ZeroOrderAssembler.h"
#include "FirstOrderAssembler.h"
#include "SecondOrderAssembler.h"
...
...
AMDiS/src/Boundary.h
View file @
c3474ca2
...
...
@@ -24,7 +24,6 @@
#include <map>
#include "Global.h"
#include "MemoryManager.h"
namespace
AMDiS
{
...
...
AMDiS/src/CoarseningManager1d.h
View file @
c3474ca2
...
...
@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_1D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace
AMDiS
{
// ============================================================================
// ===== class CoarseningManager1d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 1-dimensional meshes.
...
...
@@ -38,17 +33,13 @@ namespace AMDiS {
class
CoarseningManager1d
:
public
CoarseningManager
{
public:
MEMORY_MANAGED
(
CoarseningManager1d
);
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager1d
()
:
CoarseningManager
()
{}
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager1d
()
:
CoarseningManager
()
{};
/** \brief
* destructor
*/
virtual
~
CoarseningManager1d
()
{};
/// destructor
virtual
~
CoarseningManager1d
()
{}
/** \brief
* Overloads CoarseningManager::coarsenMesh. In 1d a simple recursive
...
...
@@ -57,18 +48,14 @@ namespace AMDiS {
Flag
coarsenMesh
(
Mesh
*
aMesh
);
protected:
/** \brief
* Not needed in this sub class
*/
/// Not needed in this sub class
int
coarsenFunction
(
ElInfo
*
)
{
FUNCNAME
(
"CoarseningManager1d::coarsenFunction"
);
ERROR_EXIT
(
"not used for dim = 1"
);
return
0
;
}
;
}
/** \brief
* Needed instead of coarsenFunction in 1d.
*/
/// Needed instead of coarsenFunction in 1d.
int
coarsenRecursive
(
Line
*
parent
);
};
...
...
AMDiS/src/CoarseningManager2d.h
View file @
c3474ca2
...
...
@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_2D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace
AMDiS
{
// ============================================================================
// ===== class CoarseningManager2d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 2-dimensional meshes.
...
...
@@ -38,25 +33,17 @@ namespace AMDiS {
class
CoarseningManager2d
:
public
CoarseningManager
{
public:
MEMORY_MANAGED
(
CoarseningManager2d
);
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager2d
()
:
CoarseningManager
()
{
// FUNCNAME("CoarseningManager2d::CoarseningManager2d");
// TEST_EXIT(mesh->getDim()==2)("mesh->dim != 2\n");
};
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager2d
()
:
CoarseningManager
()
{}
/** \brief
* destructor
*/
virtual
~
CoarseningManager2d
()
{};
/// destructor
virtual
~
CoarseningManager2d
()
{}
protected:
/** \brief
* Implements CoarseningManager::coarsenFunction
*/
/// Implements CoarseningManager::coarsenFunction
virtual
int
coarsenFunction
(
ElInfo
*
el_info
);
/** \brief
...
...
AMDiS/src/CoarseningManager3d.h
View file @
c3474ca2
...
...
@@ -23,14 +23,9 @@
#define AMDIS_COARSENINGMANAGER_3D_H
#include "CoarseningManager.h"
#include "MemoryManager.h"
namespace
AMDiS
{
// ============================================================================
// ===== class CoarseningManager3d ============================================
// ============================================================================
/** \ingroup Adaption
* \brief
* Implements a CoarseningManager for 3-dimensional meshes.
...
...
@@ -38,22 +33,16 @@ namespace AMDiS {
class
CoarseningManager3d
:
public
CoarseningManager
{
public:
MEMORY_MANAGED
(
CoarseningManager3d
);
/** \brief
* Calls base class constructor and checks dimension of mesh.
*/
CoarseningManager3d
()
:
CoarseningManager
()
{};
/// Calls base class constructor and checks dimension of mesh.
CoarseningManager3d
()
:
CoarseningManager
()
{}
/** \brief
* destructor
*/
virtual
~
CoarseningManager3d
()
{};
/// destructor
virtual
~
CoarseningManager3d
()
{}
protected:
/** \brief
* Implements CoarseningManager::coarsenFunction
*/
/// Implements CoarseningManager::coarsenFunction
int
coarsenFunction
(
ElInfo
*
el_info
);
/** \brief
...
...
AMDiS/src/ConditionalEstimator.h
View file @
c3474ca2
...
...
@@ -30,10 +30,6 @@
namespace
AMDiS
{
// ============================================================================
// ===== class ConditionalEstimator ==============================================
// ============================================================================
/**
* \ingroup Estimator
*
...
...
@@ -43,45 +39,21 @@ namespace AMDiS {
class
ConditionalEstimator
:
public
Estimator
{
public:
MEMORY_MANAGED
(
ConditionalEstimator
);
ConditionalEstimator
(
Estimator
*
decorated
)
:
decoratedEstimator_
(
decorated
),
elementCount_
(
0
),
row_
(
decorated
?
decorated
->
getRow
()
:
0
)
{}
;
{}
double
estimate
(
double
timestep
);
inline
int
getElementCount
()
{
return
elementCount_
;
};
// inline double getErrorSum() const {
// return decoratedEstimator_->getErrorSum();
// };
// inline void setErrorSum(double sum) {
// decoratedEstimator_->setErrorSum(sum);
// };
// inline double getErrorMax() const {
// return decoratedEstimator_->getErrorMax();
// };
// inline double getTimeEst() const {
// return decoratedEstimator_->getTimeEst();
// };
// inline void setErrorMax(double m) {
// decoratedEstimator_->setErrorMax(m);
// };
// inline Norm getErrorNorm() {
// return decoratedEstimator_->getErrorNorm();
// };
}
inline
Estimator
*
getDecoratedEstimator
()
{
return
decoratedEstimator_
;
};
inline
Estimator
*
getDecoratedEstimator
()
{
return
decoratedEstimator_
;
}
protected:
Estimator
*
decoratedEstimator_
;
...
...
AMDiS/src/ConditionalMarker.h
View file @
c3474ca2
...
...
@@ -25,17 +25,12 @@
#include "mpi.h"
#include "Marker.h"
#include "Marker.h"
#include "MemoryManager.h"
#include "PartitionElementData.h"
#include "Traverse.h"
#include "ElInfo.h"
namespace
AMDiS
{
// ===========================================================================
// ===== class ESMarker ======================================================
// ===========================================================================
/**
* \ingroup Adaption
*
...
...
@@ -45,11 +40,7 @@ namespace AMDiS {
class
ConditionalMarker
:
public
Marker
{
public:
MEMORY_MANAGED
(
ConditionalMarker
);
/** \brief
* Constructor.
*/
/// Constructor.
ConditionalMarker
(
const
std
::
string
name
,
int
row
,
Marker
*
decoratedMarker
,
...
...
@@ -59,18 +50,18 @@ namespace AMDiS {
decoratedMarker_
(
decoratedMarker
),
globalCoarseGridLevel_
(
globalCoarseGridLevel
),
localCoarseGridLevel_
(
localCoarseGridLevel
)
{}
;
{}
/** \brief
* Implementation of MarkScal::initMarking().
*/
virtual
void
initMarking
(
AdaptInfo
*
adaptInfo
,
Mesh
*
mesh
)
{
if
(
decoratedMarker_
)
/// Implementation of MarkScal::initMarking().
virtual
void
initMarking
(
AdaptInfo
*
adaptInfo
,
Mesh
*
mesh
)
{
if
(
decoratedMarker_
)
decoratedMarker_
->
initMarking
(
adaptInfo
,
mesh
);
}
;
}
virtual
void
finishMarking
(
AdaptInfo
*
adaptInfo
)
{
if
(
decoratedMarker_
)
{
virtual
void
finishMarking
(
AdaptInfo
*
adaptInfo
)
{
if
(
decoratedMarker_
)
{
int
tmp
=
decoratedMarker_
->
getElMarkRefine
();
MPI
::
COMM_WORLD
.
Allreduce
(
&
tmp
,
&
elMarkRefine
,
...
...
@@ -85,10 +76,12 @@ namespace AMDiS {
MPI_SUM
);
decoratedMarker_
->
finishMarking
(
adaptInfo
);
}
}
;
}
void
markElement
(
AdaptInfo
*
adaptInfo
,
ElInfo
*
elInfo
)
{
void
markElement
(
AdaptInfo
*
adaptInfo
,
ElInfo
*
elInfo
)
{
FUNCNAME
(
"ConditionalMarker::markElement()"
);
if
(
decoratedMarker_
)
{
PartitionElementData
*
elData
=
dynamic_cast
<
PartitionElementData
*>
(
elInfo
->
getElement
()
->
...
...
@@ -110,11 +103,11 @@ namespace AMDiS {
localCoarseGridLevel_
:
globalCoarseGridLevel_
;
if
(
elData
->
getLevel
()
+
elInfo
->
getElement
()
->
getMark
()
<
minLevel
)
{
if
(
elData
->
getLevel
()
+
elInfo
->
getElement
()
->
getMark
()
<
minLevel
)
{
elInfo
->
getElement
()
->
setMark
(
-
(
elData
->
getLevel
()
-
minLevel
));
}
}
}
;
}
protected:
Marker
*
decoratedMarker_
;
...
...
AMDiS/src/CouplingTimeInterface.h
View file @
c3474ca2
...
...
@@ -22,16 +22,12 @@
#ifndef AMDIS_COUPLINGTIMEINTERFACE_H
#define AMDIS_COUPLINGTIMEINTERFACE_H
#include <vector>
#include "Flag.h"
#include "ProblemTimeInterface.h"
#include <vector>
namespace
AMDiS
{
// ============================================================================
// ===== class CouplingTimeInterface ==========================================
// ============================================================================
/**
* \ingroup Problem
*
...
...
@@ -40,64 +36,52 @@ namespace AMDiS {
class
CouplingTimeInterface
:
public
ProblemTimeInterface
{
public:
void
addTimeInterface
(
ProblemTimeInterface
*
interface
)
{
void
addTimeInterface
(
ProblemTimeInterface
*
interface
)
{
interfaces_
.
push_back
(
interface
);
}
;
}
/** \brief
* Executes all needed operations when the simulation time changes.
*/
virtual
void
setTime
(
AdaptInfo
*
adaptInfo
)
{
int
i
,
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
i
=
0
;
i
<
size
;
i
++
)
{
/// Executes all needed operations when the simulation time changes.
virtual
void
setTime
(
AdaptInfo
*
adaptInfo
)
{
int
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
interfaces_
[
i
]
->
setTime
(
adaptInfo
);
}
};
}
/** \brief
* Called at the beginning of each timestep
*/
virtual
void
initTimestep
(
AdaptInfo
*
adaptInfo
)
{
int
i
,
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
i
=
0
;
i
<
size
;
i
++
)
{
/// Called at the beginning of each timestep
virtual
void
initTimestep
(
AdaptInfo
*
adaptInfo
)
{
int
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
interfaces_
[
i
]
->
initTimestep
(
adaptInfo
);
}
};
}
/** \brief
* Called at the end of each timestep.
*/
virtual
void
closeTimestep
(
AdaptInfo
*
adaptInfo
)
{
/// Called at the end of each timestep.
virtual
void
closeTimestep
(
AdaptInfo
*
adaptInfo
)
{
int
i
,
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
i
=
0
;
i
<
size
;
i
++
)
{
for
(
int
i
=
0
;
i
<
size
;
i
++
)
interfaces_
[
i
]
->
closeTimestep
(
adaptInfo
);
}
};
}
/** \brief
* Solves the initial problem.
*/
virtual
void
solveInitialProblem
(
AdaptInfo
*
adaptInfo
)
{
int
i
,
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
i
=
0
;
i
<
size
;
i
++
)
{
/// Solves the initial problem.
virtual
void
solveInitialProblem
(
AdaptInfo
*
adaptInfo
)
{
int
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
interfaces_
[
i
]
->
solveInitialProblem
(
adaptInfo
);
}
};
}
/** \brief
* Solves the initial problem.
*/
/// Solves the initial problem.
virtual
void
transferInitialSolution
(
AdaptInfo
*
adaptInfo
)
{
int
i
,
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
i
=
0
;
i
<
size
;
i
++
)
{
int
size
=
static_cast
<
int
>
(
interfaces_
.
size
());
for
(
int
i
=
0
;
i
<
size
;
i
++
)
interfaces_
[
i
]
->
transferInitialSolution
(
adaptInfo
);
}
};
}
protected:
/** \brief
* vector of coupled time interfaces
*/
/// vector of coupled time interfaces
std
::
vector
<
ProblemTimeInterface
*>
interfaces_
;
};
...
...
AMDiS/src/CreatorInterface.h
View file @
c3474ca2
...
...
@@ -50,16 +50,14 @@ namespace AMDiS {
*/
virtual
BaseClass
*
create
()
=
0
;
virtual
BaseClass
*
create
(
const
DOFMatrix
::
base_matrix_type
&
A
)
{
return
0
;
}
virtual
BaseClass
*
create
(
const
DOFMatrix
::
base_matrix_type
&
A
)
{
return
0
;
}
/** \brief
* Can be implemented by sub classes.
*/
/// Can be implemented by sub classes.
virtual
void
free
(
BaseClass
*
)
{}
/** \brief
*
*/
///
virtual
bool
isNullCreator
()
{
return
false
;
}
...
...
@@ -72,16 +70,12 @@ namespace AMDiS {
template
<
typename
BaseClass
>
class
NullCreator
:
public
CreatorInterface
<
BaseClass
>
{
/** \brief
* Creates no object.
*/
BaseClass
*
create
()
{
/// Creates no object.
BaseClass
*
create
()
{
return
NULL
;
}
/** \brief
*
*/
///
virtual
bool
isNullCreator
()
{
return
true
;
}
...
...
AMDiS/src/CylinderProject.h
View file @
c3474ca2
...
...
@@ -24,10 +24,6 @@
namespace
AMDiS
{
// ==============================================================================
// ===== class CylinderProject ==================================================
// ==============================================================================
/** \brief
* Projects world coordinates to the surface of a cylinder with given center,
* radius and direction. Can be used as boundary or volume projection.
...
...
@@ -35,9 +31,7 @@ namespace AMDiS {
class
CylinderProject
:
public
Projection
{
public:
/** \brief
* Constructor.
*/
/// Constructor.
CylinderProject
(
int
id
,
ProjectionType
type
,
WorldVector
<
double
>
&
c
,
...
...
@@ -50,17 +44,14 @@ namespace AMDiS {
{
double
norm
=
sqrt
(
direction_
*
direction_
);
direction_
*=
1.0
/
norm
;
}
;
}
/** \brief
* Destructor.
*/
virtual
~
CylinderProject
()
{};
/// Destructor.
virtual
~
CylinderProject
()
{}
/** \brief
* Implementation of Projection::project();
*/
void
project
(
WorldVector
<
double
>
&
x
)
{
/// Implementation of Projection::project();
void
project
(
WorldVector
<
double
>
&
x
)
{
x
-=
center_
;
WorldVector
<
double
>
v1
=
direction_
;
v1
*=
(
x
*
direction_
);
WorldVector
<
double
>
v2
=
x
;
v2
-=
v1
;
...
...
@@ -69,22 +60,16 @@ namespace AMDiS {
v2
*=
1.0
/
norm
;
x
=
v2
;
x
*=
radius_
;
x
+=
v1
;
x
+=
center_
;
}
;
}
protected:
/** \brief
* Center of the cylinder.
*/
/// Center of the cylinder.
WorldVector
<
double
>
center_
;
/** \brief
* Direction of the cylinder.
*/
/// Direction of the cylinder.
WorldVector
<
double
>
direction_
;
/** \brief
* Radius of the cylinder.
*/
/// Radius of the cylinder.
double
radius_
;
};
...
...
AMDiS/src/DOFAdmin.h
View file @
c3474ca2
...
...
@@ -28,27 +28,17 @@
#ifndef AMDIS_DOFADMIN_H
#define AMDIS_DOFADMIN_H
#include <vector>
#include <memory>
#include <list>
#include "Global.h"
#include "FixVec.h"
#include "MemoryManager.h"
#include "Serializable.h"
#include "OpenMP.h"
#include <vector>
#include <memory>
#include <list>
#include "AMDiS_fwd.h"
namespace
AMDiS
{
class
Mesh
;
class
FiniteElemSpace
;
class
ElInfo
;
class
DOFAdmin
;
class
BasisFunction
;
class
DOFIndexedBase
;
class
DOFContainer
;
template
<
typename
T
>
class
DOFVector
;
/** \ingroup DOFAdministration
* \brief