Commit c1eca4e2 authored by Thomas Witkowski's avatar Thomas Witkowski
Browse files

UAH, IST DAS GROSSSSSSS

parent 56c306c7
...@@ -125,6 +125,7 @@ namespace AMDiS { ...@@ -125,6 +125,7 @@ namespace AMDiS {
#ifdef HAVE_PARALLEL_DOMAIN_AMDIS #ifdef HAVE_PARALLEL_DOMAIN_AMDIS
MeshDistributor::globalMeshDistributor->exitParallelization(); MeshDistributor::globalMeshDistributor->exitParallelization();
delete MeshDistributor::globalMeshDistributor;
#ifdef HAVE_PARALLEL_MTL4 #ifdef HAVE_PARALLEL_MTL4
if (mtl_environment) if (mtl_environment)
delete mtl_environment; delete mtl_environment;
......
...@@ -177,11 +177,9 @@ namespace AMDiS { ...@@ -177,11 +177,9 @@ namespace AMDiS {
return vectorComponents[row].getStatus(); return vectorComponents[row].getStatus();
} }
/** \brief /// Returns true, if for the given matrix component the row and the col FE spaces
* Returns true, if for the given matrix component the row and the col FE spaces /// are equal. Note that this is also the case, if there is another aux FE space,
* are equal. Note that this is also the case, if there is another aux FE space, /// that may be different from both, the row and the col FE spaces.
* that may be different from both, the row and the col FE spaces.
*/
inline bool eqSpaces(int row, int col) const inline bool eqSpaces(int row, int col) const
{ {
int status = matrixComponents[row][col].getStatus(); int status = matrixComponents[row][col].getStatus();
......
...@@ -1495,11 +1495,12 @@ namespace AMDiS { ...@@ -1495,11 +1495,12 @@ namespace AMDiS {
for (int iq = 0; iq < nPoints; iq++) { for (int iq = 0; iq < nPoints; iq++) {
nullify(grd1); nullify(grd1);
for (int j = 0; j < nBasFcts; j++) // #BasisFunctions for (int j = 0; j < nBasFcts; j++) { // #BasisFunctions
for (int k = 0; k < parts; k++) // #edges (2d) or #faces (3d) for (int k = 0; k < parts; k++) // #edges (2d) or #faces (3d)
grd1[k] += quadFast->getGradient(iq, j, k) * localVec[j]; grd1[k] += quadFast->getGradient(iq, j, k) * localVec[j];
}
for (int l=0; l < dow; l++) { for (int l = 0; l < dow; l++) {
nullify(grdAtQPs[iq][l]); nullify(grdAtQPs[iq][l]);
for (int k = 0; k < parts; k++) for (int k = 0; k < parts; k++)
grdAtQPs[iq][l] += grdLambda[k][l] * grd1[k]; grdAtQPs[iq][l] += grdLambda[k][l] * grd1[k];
......
...@@ -51,20 +51,16 @@ namespace AMDiS { ...@@ -51,20 +51,16 @@ namespace AMDiS {
/// Protected constructor. Avoids instatiation of the basis class /// Protected constructor. Avoids instatiation of the basis class
ElInfo(); ElInfo();
/** \brief /// Protected constructor. Avoids instatiation of the basis class.
* Protected constructor. Avoids instatiation of the basis class. /// \param mesh pointer to the corresponding mesh.
* \param mesh pointer to the corresponding mesh.
*/
ElInfo(Mesh *mesh); ElInfo(Mesh *mesh);
public: public:
/// Virtual destructor because ElInfo is pure virtual. /// Virtual destructor because ElInfo is pure virtual.
virtual ~ElInfo(); virtual ~ElInfo();
/** \brief /// Assignement operator.
* Assignement operator. /// \param rhs right hand side.
* \param rhs right hand side.
*/
ElInfo& operator=(const ElInfo& rhs) ElInfo& operator=(const ElInfo& rhs)
{ {
mesh = rhs.mesh; mesh = rhs.mesh;
...@@ -137,37 +133,29 @@ namespace AMDiS { ...@@ -137,37 +133,29 @@ namespace AMDiS {
return iChild; return iChild;
} }
/** \brief /// Get ElInfo's \ref coord[i]. This is a WorldVector<double> filled with
* Get ElInfo's \ref coord[i]. This is a WorldVector<double> filled with the /// the coordinates of the i-th vertex of element \ref el.
* coordinates of the i-th vertex of element \ref el.
*/
inline WorldVector<double>& getCoord(int i) inline WorldVector<double>& getCoord(int i)
{ {
return coord[i]; return coord[i];
} }
/** \brief /// Get ElInfo's \ref coord[i]. This is a WorldVector<double> filled with the
* Get ElInfo's \ref coord[i]. This is a WorldVector<double> filled with the /// coordinates of the i-th vertex of element \ref el.
* coordinates of the i-th vertex of element \ref el.
*/
inline const WorldVector<double>& getCoord(int i) const inline const WorldVector<double>& getCoord(int i) const
{ {
return coord[i]; return coord[i];
} }
/** \brief /// Get ElInfo's \ref coord. This is a FixVec<WorldVector<double> > filled
* Get ElInfo's \ref coord. This is a FixVec<WorldVector<double> > filled with the /// with the coordinates of the all vertice of element \ref el.
* coordinates of the all vertice of element \ref el.
*/
inline FixVec<WorldVector<double>, VERTEX>& getCoords() inline FixVec<WorldVector<double>, VERTEX>& getCoords()
{ {
return coord; return coord;
} }
/** \brief /// Get ElInfo's \ref coord. This is a FixVec<WorldVector<double> > filled
* Get ElInfo's \ref coord. This is a FixVec<WorldVector<double> > filled with the /// with the coordinates of the all vertice of element \ref el.
* coordinates of the all vertice of element \ref el.
*/
inline const FixVec<WorldVector<double>, VERTEX>& getCoords() const inline const FixVec<WorldVector<double>, VERTEX>& getCoords() const
{ {
return coord; return coord;
...@@ -370,83 +358,67 @@ namespace AMDiS { ...@@ -370,83 +358,67 @@ namespace AMDiS {
/** \} */ /** \} */
/** \brief /// Returns the absolute value of the determinant of the affine linear
* Returns the absolute value of the determinant of the affine linear /// parametrization's Jacobian
* parametrization's Jacobian
*/
virtual double calcDet() const; virtual double calcDet() const;
/** \brief /// Used by non static method \ref calcDet(). Calculates the determinant
* Used by non static method \ref calcDet(). Calculates the determinant /// for a given vector of vertex coordinates.
* for a given vector of vertex coordinates.
*/
double calcDet(const FixVec<WorldVector<double>, VERTEX> &coords) const; double calcDet(const FixVec<WorldVector<double>, VERTEX> &coords) const;
/// from CFE_Integration /// from CFE_Integration
double calcSurfaceDet(VectorOfFixVecs<DimVec<double> > &surfVert) const; double calcSurfaceDet(VectorOfFixVecs<DimVec<double> > &surfVert) const;
/// Checks whether flag is set in ElInfo's \ref fillFlag. If not, the program exits. /// Checks whether flag is set in ElInfo's \ref fillFlag. If not, the
/// program exits.
void testFlag(const Flag& flag) const; void testFlag(const Flag& flag) const;
/** \brief /// Transforms local barycentric coordinates of a point defined on this
* Transforms local barycentric coordinates of a point defined on this element /// element to global world coordinates.
* to global world coordinates.
*/
void coordToWorld(const DimVec<double>& lambda, void coordToWorld(const DimVec<double>& lambda,
WorldVector<double>& world) const; WorldVector<double>& world) const;
/// Fills ElInfo's \ref det and \ref grdLambda entries. /// Fills ElInfo's \ref det and \ref grdLambda entries.
virtual void fillDetGrdLambda(); virtual void fillDetGrdLambda();
/** \brief /// Returns a pointer to a vector, which contains the barycentric coordinates
* Returns a pointer to a vector, which contains the barycentric coordinates /// with respect to \ref element of a point with world coordinates world.
* with respect to \ref element of a point with world coordinates world. /// The barycentric coordinates are stored in lambda.
* The barycentric coordinates are stored in lambda. /// pure virtual => must be overriden in sub-class.
* pure virtual => must be overriden in sub-class.
*/
virtual const int worldToCoord(const WorldVector<double>& world, virtual const int worldToCoord(const WorldVector<double>& world,
DimVec<double>* lambda) const = 0; DimVec<double>* lambda) const = 0;
/** \brief /// Fills this ElInfo with macro element information of mel.
* Fills this ElInfo with macro element information of mel. /// pure virtual => must be overriden in sub-class.
* pure virtual => must be overriden in sub-class.
*/
virtual void fillMacroInfo(const MacroElement *mel) = 0; virtual void fillMacroInfo(const MacroElement *mel) = 0;
/** \brief /// Fills this ElInfo for the child ichild using hierarchy information and
* Fills this ElInfo for the child ichild using hierarchy information and /// parent data parentInfo.
* parent data parentInfo. /// pure virtual => must be overriden in sub-class.
* pure virtual => must be overriden in sub-class.
*/
virtual void fillElInfo(int ichild, const ElInfo *parentInfo) = 0; virtual void fillElInfo(int ichild, const ElInfo *parentInfo) = 0;
void fillElInfo(const MacroElement *mel, int refinementPathLength, unsigned long refinementPath); void fillElInfo(const MacroElement *mel,
int refinementPathLength,
unsigned long refinementPath);
/** \brief /// Calculates the Jacobian of the barycentric coordinates on \element and
* Calculates the Jacobian of the barycentric coordinates on \element and /// stores the matrix in grd_lam. The return value of the function is the
* stores the matrix in grd_lam. The return value of the function is the /// absolute value of the determinant of the affine linear paraetrization's
* absolute value of the determinant of the affine linear paraetrization's /// Jacobian.
* Jacobian. /// pure virtual => must be overriden in sub-class.
* pure virtual => must be overriden in sub-class.
*/
virtual double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam) = 0; virtual double calcGrdLambda(DimVec<WorldVector<double> >& grd_lam) = 0;
/** \brief /// calculates a normal of the given side (1d, 2d: edge, 3d: face) of \ref element.
* calculates a normal of the given side (1d, 2d: edge, 3d: face) of \ref element. /// Returns the absolute value of the determinant of the
* Returns the absolute value of the determinant of the /// transformation to the reference element.
* transformation to the reference element. /// pure virtual => must be overriden in sub-class.
* pure virtual => must be overriden in sub-class.
*/
virtual double getNormal(int side, WorldVector<double> &normal) const = 0; virtual double getNormal(int side, WorldVector<double> &normal) const = 0;
/// calculates a normal of the element in dim of world = dim + 1.
/** \brief /// Returns the absolute value of the determinant of the
* calculates a normal of the element in dim of world = dim + 1. /// transformation to the reference element.
* Returns the absolute value of the determinant of the /// pure virtual => must be overriden in sub-class.
* transformation to the reference element.
* pure virtual => must be overriden in sub-class.
*/
virtual double getElementNormal(WorldVector<double> &elementNormal) const virtual double getElementNormal(WorldVector<double> &elementNormal) const
{ {
FUNCNAME("ElInfo::getElementNormal()"); FUNCNAME("ElInfo::getElementNormal()");
......
...@@ -63,7 +63,6 @@ namespace AMDiS { ...@@ -63,7 +63,6 @@ namespace AMDiS {
} }
FiniteElemSpace::FiniteElemSpace() FiniteElemSpace::FiniteElemSpace()
{} {}
...@@ -104,6 +103,14 @@ namespace AMDiS { ...@@ -104,6 +103,14 @@ namespace AMDiS {
} }
void FiniteElemSpace::destroyFeSpaces()
{
for (unsigned int i = 0; i < feSpaces.size(); i++)
delete feSpaces[i];
feSpaces.resize(0);
}
#if DEBUG #if DEBUG
FiniteElemSpace* FiniteElemSpace::provideFeSpace(Mesh *mesh) FiniteElemSpace* FiniteElemSpace::provideFeSpace(Mesh *mesh)
{ {
......
...@@ -51,6 +51,8 @@ namespace AMDiS { ...@@ -51,6 +51,8 @@ namespace AMDiS {
Mesh *mesh, Mesh *mesh,
string name = ""); string name = "");
static void destroyFeSpaces();
#if DEBUG #if DEBUG
/// For debugging it may be useful to get some FE space for a given mesh at a /// For debugging it may be useful to get some FE space for a given mesh at a
/// position in code where it is not possible to access the FE space directly. The /// position in code where it is not possible to access the FE space directly. The
...@@ -104,10 +106,8 @@ namespace AMDiS { ...@@ -104,10 +106,8 @@ namespace AMDiS {
getHighest(vector<const FiniteElemSpace*>& feSpaces); getHighest(vector<const FiniteElemSpace*>& feSpaces);
protected: protected:
/** \brief /// Constructs a FiniteElemSpace with name name_ and the given DOFAdmin,
* Constructs a FiniteElemSpace with name name_ and the given DOFAdmin, /// BasisFunction and Mesh.
* BasisFunction and Mesh.
*/
FiniteElemSpace(DOFAdmin* admin, FiniteElemSpace(DOFAdmin* admin,
const BasisFunction* basisFcts, const BasisFunction* basisFcts,
Mesh* mesh, Mesh* mesh,
......
...@@ -99,7 +99,7 @@ namespace AMDiS { ...@@ -99,7 +99,7 @@ namespace AMDiS {
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
} }
void CoordsAtQP_FOT::getLb(const ElInfo *elInfo, void CoordsAtQP_FOT::getLb(const ElInfo *elInfo,
...@@ -140,7 +140,7 @@ namespace AMDiS { ...@@ -140,7 +140,7 @@ namespace AMDiS {
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
} }
void VecCoordsAtQP_FOT::getLb(const ElInfo *elInfo, void VecCoordsAtQP_FOT::getLb(const ElInfo *elInfo,
...@@ -281,7 +281,7 @@ namespace AMDiS { ...@@ -281,7 +281,7 @@ namespace AMDiS {
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
{ {
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
} }
...@@ -477,7 +477,7 @@ namespace AMDiS { ...@@ -477,7 +477,7 @@ namespace AMDiS {
Quadrature *quad) Quadrature *quad)
{ {
getVectorAtQPs(vec, elInfo, subAssembler, quad, vecAtQPs); getVectorAtQPs(vec, elInfo, subAssembler, quad, vecAtQPs);
coordsAtQPs = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
} }
void FctVecAtQP_FOT::getLb(const ElInfo *elInfo, void FctVecAtQP_FOT::getLb(const ElInfo *elInfo,
...@@ -686,7 +686,7 @@ namespace AMDiS { ...@@ -686,7 +686,7 @@ namespace AMDiS {
int nVecs = static_cast<int>(vecs_.size()); int nVecs = static_cast<int>(vecs_.size());
int nGrads = static_cast<int>(grads_.size()); int nGrads = static_cast<int>(grads_.size());
coordsAtQPs_ = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
for (int i = 0; i < nVecs; i++) for (int i = 0; i < nVecs; i++)
getVectorAtQPs(vecs_[i], elInfo, subAssembler, quad, vecsAtQPs[i]); getVectorAtQPs(vecs_[i], elInfo, subAssembler, quad, vecsAtQPs[i]);
...@@ -713,7 +713,7 @@ namespace AMDiS { ...@@ -713,7 +713,7 @@ namespace AMDiS {
for (int i = 0; i < nGrads; i++) for (int i = 0; i < nGrads; i++)
gradsArg[i] = gradsAtQPs_[i][iq]; gradsArg[i] = gradsAtQPs_[i][iq];
lb(grdLambda, (*f_)(coordsAtQPs_[iq], vecsArg, gradsArg), Lb[iq], 1.0); lb(grdLambda, (*f_)(coordsAtQPs[iq], vecsArg, gradsArg), Lb[iq], 1.0);
} }
} }
...@@ -741,7 +741,7 @@ namespace AMDiS { ...@@ -741,7 +741,7 @@ namespace AMDiS {
for (int i = 0; i < nGrads; i++) for (int i = 0; i < nGrads; i++)
gradsArg[i] = gradsAtQPs_[i][iq]; gradsArg[i] = gradsAtQPs_[i][iq];
const WorldVector<double> &b = (*f_)(coordsAtQPs_[iq], vecsArg, gradsArg); const WorldVector<double> &b = (*f_)(coordsAtQPs[iq], vecsArg, gradsArg);
for (int i = 0; i < dow; i++) for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i] * b[i]; resultQP += grdUhAtQP[iq][i] * b[i];
...@@ -788,7 +788,7 @@ namespace AMDiS { ...@@ -788,7 +788,7 @@ namespace AMDiS {
int nGrads = static_cast<int>(grads_.size()); int nGrads = static_cast<int>(grads_.size());
elInfo->getElementNormal(elementNormal_); elInfo->getElementNormal(elementNormal_);
coordsAtQPs_ = subAssembler->getCoordsAtQPs(elInfo, quad); subAssembler->getCoordsAtQPs(elInfo, quad, coordsAtQPs);
for (int i = 0; i < nVecs; i++) for (int i = 0; i < nVecs; i++)
getVectorAtQPs(vecs_[i], elInfo, subAssembler, quad, vecsAtQPs[i]); getVectorAtQPs(vecs_[i], elInfo, subAssembler, quad, vecsAtQPs[i]);
...@@ -815,18 +815,18 @@ namespace AMDiS { ...@@ -815,18 +815,18 @@ namespace AMDiS {
for (int i = 0; i < nGrads; i++) for (int i = 0; i < nGrads; i++)
gradsArg[i] = gradsAtQPs_[i][iq]; gradsArg[i] = gradsAtQPs_[i][iq];
lb(grdLambda, (*f_)(coordsAtQPs_[iq], elementNormal_, vecsArg, gradsArg), lb(grdLambda, (*f_)(coordsAtQPs[iq], elementNormal_, vecsArg, gradsArg),
Lb[iq], 1.0); Lb[iq], 1.0);
} }
} }
void GeneralParametric_FOT::eval( int nPoints, void GeneralParametric_FOT::eval(int nPoints,
const mtl::dense_vector<double>& uhAtQP, const mtl::dense_vector<double>& uhAtQP,
const mtl::dense_vector<WorldVector<double> >& grdUhAtQP, const mtl::dense_vector<WorldVector<double> >& grdUhAtQP,
const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP, const mtl::dense_vector<WorldMatrix<double> >& D2UhAtQP,
mtl::dense_vector<double>& result, mtl::dense_vector<double>& result,
double factor) double factor)
{ {
int dow = Global::getGeo(WORLD); int dow = Global::getGeo(WORLD);
int nVecs = static_cast<int>(vecs_.size()); int nVecs = static_cast<int>(vecs_.size());
...@@ -845,7 +845,7 @@ namespace AMDiS { ...@@ -845,7 +845,7 @@ namespace AMDiS {
gradsArg[i] = gradsAtQPs_[i][iq]; gradsArg[i] = gradsAtQPs_[i][iq];
const WorldVector<double> &b = const WorldVector<double> &b =
(*f_)(coordsAtQPs_[iq], elementNormal_, vecsArg, gradsArg); (*f_)(coordsAtQPs[iq], elementNormal_, vecsArg, gradsArg);
for (int i = 0; i < dow; i++) for (int i = 0; i < dow; i++)
resultQP += grdUhAtQP[iq][i] * b[i]; resultQP += grdUhAtQP[iq][i] * b[i];
......
...@@ -336,7 +336,7 @@ namespace AMDiS { ...@@ -336,7 +336,7 @@ namespace AMDiS {
protected: protected:
/// Stores coordinates at quadrature points. Set in \ref initElement(). /// Stores coordinates at quadrature points. Set in \ref initElement().
WorldVector<double>* coordsAtQPs; mtl::dense_vector<WorldVector<double> > coordsAtQPs;
/// Function avaluated at world coordinates. /// Function avaluated at world coordinates.
AbstractFunction<double, WorldVector<double> > *g; AbstractFunction<double, WorldVector<double> > *g;
...@@ -375,7 +375,7 @@ namespace AMDiS { ...@@ -375,7 +375,7 @@ namespace AMDiS {
protected: protected:
/// Stores coordinates at quadrature points. Set in \ref initElement(). /// Stores coordinates at quadrature points. Set in \ref initElement().
WorldVector<double>* coordsAtQPs; mtl::dense_vector<WorldVector<double> > coordsAtQPs;
/// Function evaluated at world coordinates. /// Function evaluated at world coordinates.
AbstractFunction<double, WorldVector<double> > *g; AbstractFunction<double, WorldVector<double> > *g;
...@@ -495,7 +495,7 @@ namespace AMDiS { ...@@ -495,7 +495,7 @@ namespace AMDiS {
protected: protected:
/// Stores coordinates at quadrature points. Set in \ref initElement(). /// Stores coordinates at quadrature points. Set in \ref initElement().
WorldVector<double>* coordsAtQPs; mtl::dense_vector<WorldVector<double> > coordsAtQPs;
/// Function avaluated at world coordinates. /// Function avaluated at world coordinates.
AbstractFunction<WorldVector<double>, WorldVector<double> > *g; AbstractFunction<WorldVector<double>, WorldVector<double> > *g;
...@@ -657,9 +657,13 @@ namespace AMDiS { ...@@ -657,9 +657,13 @@ namespace AMDiS {
protected: protected:
DOFVectorBase<double>* vec; DOFVectorBase<double>* vec;
mtl::dense_vector<double> vecAtQPs; mtl::dense_vector<double> vecAtQPs;
WorldVector<double> *coordsAtQPs;
mtl::dense_vector<WorldVector<double> > coordsAtQPs;
BinaryAbstractFunction<double, WorldVector<double>, double> *f; BinaryAbstractFunction<double, WorldVector<double>, double> *f;
WorldVector<double> *b; WorldVector<double> *b;
}; };
...@@ -772,7 +776,7 @@ namespace AMDiS { ...@@ -772,7 +776,7 @@ namespace AMDiS {
vector<double>, vector<double>,
vector<WorldVector<double> > > *f_; vector<WorldVector<double> > > *f_;
WorldVector<double> *coordsAtQPs_; mtl::dense_vector<WorldVector<double> > coordsAtQPs;
vector<mtl::dense_vector<double> > vecsAtQPs; vector<mtl::dense_vector<double> > vecsAtQPs;
...@@ -818,7 +822,8 @@ namespace AMDiS { ...@@ -818,7 +822,8 @@ namespace AMDiS {
vector<double>, vector<double>,
vector<WorldVector<double> > > *f_; vector<WorldVector<double> > > *f_;
WorldVector<double> *coordsAtQPs_; mtl::dense_vector<WorldVector<double> > coordsAtQPs;
WorldVector<double> elementNormal_; WorldVector<double> elementNormal_;
vector<mtl::dense_vector<double> > vecsAtQPs; vector<mtl::dense_vector<double> > vecsAtQPs;
......
...@@ -53,20 +53,16 @@ namespace AMDiS { ...@@ -53,20 +53,16 @@ namespace AMDiS {
{ {
public: public:
/** \brief /// Constructor without initialisation. initType must be NO_INIT. If dim is
* constructor without initialisation. initType must be NO_INIT. If dim is /// not spezified, a FixVec for DIM_OF_WORLD is created.
* not spezified, a FixVec for DIM_OF_WORLD is created.
*/
FixVec(int dim = -1, InitType initType = NO_INIT)