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

* This and that

parent 1500f6ae
This diff is collapsed.
...@@ -70,7 +70,7 @@ namespace AMDiS { ...@@ -70,7 +70,7 @@ namespace AMDiS {
* \brief * \brief
* Base class for SecondOrderAssembler, FirstOrderAssembler, * Base class for SecondOrderAssembler, FirstOrderAssembler,
* ZeroOrderAssembler. The task of a SubAssembler is to assemble a list of * ZeroOrderAssembler. The task of a SubAssembler is to assemble a list of
* terms of a spezial order and add their contributions to a DOFMatrix or a * terms of a special order and add their contributions to a DOFMatrix or a
* DOFVector. An Assembler can consist of up to four SubAssemblers: one * DOFVector. An Assembler can consist of up to four SubAssemblers: one
* SecondOrderAssembler for second order terms, one ZeroOrderAssembler for * SecondOrderAssembler for second order terms, one ZeroOrderAssembler for
* terms of order zero, and two FirstOrderAssemblers. One for terms with * terms of order zero, and two FirstOrderAssemblers. One for terms with
......
...@@ -251,13 +251,16 @@ namespace AMDiS { ...@@ -251,13 +251,16 @@ namespace AMDiS {
*/ */
static T* getMemory(size_t s, const char* filename, int line) { static T* getMemory(size_t s, const char* filename, int line) {
FUNCNAME("MemoryManager<T>::getMemory()"); FUNCNAME("MemoryManager<T>::getMemory()");
if(!singleton) init(); if (!singleton)
init();
byteCount += s; byteCount += s;
singleton->instanceCount += s/sizeof(T); singleton->instanceCount += s/sizeof(T);
singleton->typedByteCount += s; singleton->typedByteCount += s;
if(printInfo) { if (printInfo) {
if(filename && line) if (filename && line) {
MSG("FILE: %s, LINE: %d - ", filename, line); MSG("FILE: %s, LINE: %d - ", filename, line);
}
Msg::print("%s::getMemory : %d instances, total : %d instances\n", Msg::print("%s::getMemory : %d instances, total : %d instances\n",
singleton->getName().c_str(), s/sizeof(T), singleton->getName().c_str(), s/sizeof(T),
static_cast<int>(singleton->instanceCount)); static_cast<int>(singleton->instanceCount));
......
...@@ -239,8 +239,8 @@ namespace AMDiS { ...@@ -239,8 +239,8 @@ namespace AMDiS {
Quadrature *quad1GrdPhi, Quadrature *quad1GrdPhi,
Quadrature *quad0) Quadrature *quad0)
{ {
if(!assembler) if (!assembler)
if(optimized) { if (optimized) {
assembler = assembler =
NEW OptimizedAssembler(this, NEW OptimizedAssembler(this,
quad2, quad1GrdPsi, quad1GrdPhi, quad0, quad2, quad1GrdPsi, quad1GrdPhi, quad0,
...@@ -597,13 +597,12 @@ namespace AMDiS { ...@@ -597,13 +597,12 @@ namespace AMDiS {
} }
void VecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void VecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; if (f) {
if(f) { for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq]);
} }
} else { } else {
for(iq = 0; iq < numPoints; iq++) { for (int iq = 0; iq < numPoints; iq++) {
C[iq] += vecAtQPs[iq]; C[iq] += vecAtQPs[iq];
} }
} }
...@@ -625,8 +624,7 @@ namespace AMDiS { ...@@ -625,8 +624,7 @@ namespace AMDiS {
// Andreas ergaenzt // Andreas ergaenzt
void MultVecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void MultVecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f1)(vecAtQPs1[iq]) * (*f2)(vecAtQPs2[iq]); C[iq] += (*f1)(vecAtQPs1[iq]) * (*f2)(vecAtQPs2[iq]);
} }
} }
...@@ -649,8 +647,7 @@ namespace AMDiS { ...@@ -649,8 +647,7 @@ namespace AMDiS {
} }
void Vec2AtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void Vec2AtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs1[iq], vecAtQPs2[iq]); C[iq] += (*f)(vecAtQPs1[iq], vecAtQPs2[iq]);
} }
} }
...@@ -672,8 +669,7 @@ namespace AMDiS { ...@@ -672,8 +669,7 @@ namespace AMDiS {
} }
void VecAndCoordsAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void VecAndCoordsAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq], coordsAtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq], coordsAtQPs[iq]);
} }
} }
...@@ -696,8 +692,7 @@ namespace AMDiS { ...@@ -696,8 +692,7 @@ namespace AMDiS {
void FctGradientCoords_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void FctGradientCoords_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(gradAtQPs[iq], coordsAtQPs[iq]); C[iq] += (*f)(gradAtQPs[iq], coordsAtQPs[iq]);
} }
} }
...@@ -719,8 +714,7 @@ namespace AMDiS { ...@@ -719,8 +714,7 @@ namespace AMDiS {
} }
void VecGradCoordsAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void VecGradCoordsAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq], coordsAtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq], coordsAtQPs[iq]);
} }
} }
...@@ -744,8 +738,7 @@ namespace AMDiS { ...@@ -744,8 +738,7 @@ namespace AMDiS {
// bis hierhin // bis hierhin
void VecAndGradAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void VecAndGradAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq]);
} }
} }
...@@ -768,8 +761,7 @@ namespace AMDiS { ...@@ -768,8 +761,7 @@ namespace AMDiS {
void VecAndGradVecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const void VecAndGradVecAtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const
{ {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq], gradAtQPs[iq]);
} }
} }
...@@ -791,8 +783,7 @@ namespace AMDiS { ...@@ -791,8 +783,7 @@ namespace AMDiS {
} }
void VecAndGradVec2AtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void VecAndGradVec2AtQP_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(vecAtQPs[iq], grad1AtQPs[iq], grad2AtQPs[iq]); C[iq] += (*f)(vecAtQPs[iq], grad1AtQPs[iq], grad2AtQPs[iq]);
} }
} }
...@@ -814,8 +805,7 @@ namespace AMDiS { ...@@ -814,8 +805,7 @@ namespace AMDiS {
} }
void FctGradient_ZOT::getC(const ElInfo *, int numPoints, double *C) const { void FctGradient_ZOT::getC(const ElInfo *, int numPoints, double *C) const {
int iq; for (int iq = 0; iq < numPoints; iq++) {
for(iq = 0; iq < numPoints; iq++) {
C[iq] += (*f)(gradAtQPs[iq]); C[iq] += (*f)(gradAtQPs[iq]);
} }
} }
...@@ -1387,90 +1377,6 @@ namespace AMDiS { ...@@ -1387,90 +1377,6 @@ namespace AMDiS {
return assembler; return assembler;
} }
// Matrix<double> **OperatorVec::createElementMatrix()
// {
// int i;
// Matrix<double> **newElementMatrix = GET_MEMORY(Matrix<double>*, nRow);
// for(i=0; i < nRow; i++) {
// newElementMatrix[i] = NEW Matrix<double>[nCol](vecSize, vecSize);
// }
// return newElementMatrix;
// }
// void OperatorVec::freeElementMatrix(Matrix<double> **elMat) {
// int i;
// for(i = 0; i < nRow; i++) {
// DELETE [] elMat[i];
// }
// FREE_MEMORY(elMat, Matrix<double>*, nRow);
// }
// Vector<double> *OperatorVec::createElementVector()
// {
// return NEW Vector<double>[nRow](vecSize);
// }
// void OperatorVec::freeElementVector(Vector<double> *elVec)
// {
// DELETE [] elVec;
// }
// void OperatorVec::getElementMatrix(ElInfo *elInfo,
// Matrix<double> **userMat,
// double factor = 1.0)
// {
// int i, j, k, l;
// Operator *op = NULL;
// double **elMat = NULL;
// for(i = 0; i < operators.getNumRows(); i++) {
// for(j = 0; j < operators.getNumCols(); j++) {
// op = operators[i][j];
// if(op) {
// if(!elMat) elMat = op->createElementMatrix();
// op->resetElementMatrix(elMat);
// op->getElementMatrix(elInfo, elMat, factor);
// for(k = 0; k < nRow; k++) {
// for(l = 0; l < nCol; l++) {
// userMat[i][j][k][l] += elMat[k][l];
// }
// }
// }
// }
// }
// if(elMat) op->freeElementMatrix(elMat);
// }
// void OperatorVec::getElementVector(const ElInfo *elInfo,
// Vector<double> *userVec,
// double factor = 1.0)
// {
// int i, j, k;
// Operator *op = NULL;
// double *elVec = NULL;
// for(i = 0; i < operators.getNumRows(); i++) {
// for(j = 0; j < operators.getNumCols(); j++) {
// op = operators[i][j];
// if(op) {
// if(!elVec) elVec = op->createElementVector();
// op->resetElementVector(elVec);
// op->getElementVector(elInfo, elVec, factor);
// for(k = 0; k < nRow; k++) {
// userVec[i][k] += elVec[k];
// }
// }
// }
// }
// if(elVec) op->freeElementVector(elVec);
// }
void CoordsAtQP_IJ_SOT::initElement(const ElInfo* elInfo, void CoordsAtQP_IJ_SOT::initElement(const ElInfo* elInfo,
SubAssembler* subAssembler, SubAssembler* subAssembler,
Quadrature *quad) Quadrature *quad)
......
...@@ -114,32 +114,44 @@ namespace AMDiS { ...@@ -114,32 +114,44 @@ namespace AMDiS {
/** \brief /** \brief
* Returns \ref name * Returns \ref name
*/ */
inline const ::std::string& getName() { return name; }; inline const ::std::string& getName() {
return name;
};
/** \brief /** \brief
* Returns \ref n_points * Returns \ref n_points
*/ */
inline int getNumPoints() const { return n_points;}; inline int getNumPoints() const {
return n_points;
};
/** \brief /** \brief
* Returns \ref w[p] * Returns \ref w[p]
*/ */
inline double getWeight(int p) const {return w[p];}; inline double getWeight(int p) const {
return w[p];
};
/** \brief /** \brief
* Returns \ref w. * Returns \ref w.
*/ */
inline double* getWeight() const { return w; }; inline double* getWeight() const {
return w;
};
/** \brief /** \brief
* Returns \ref dim * Returns \ref dim
*/ */
inline int getDim() const { return dim; }; inline int getDim() const {
return dim;
};
/** \brief /** \brief
* Returns \ref degree * Returns \ref degree
*/ */
inline int getDegree() const { return degree; }; inline int getDegree() const {
return degree;
};
/** \brief /** \brief
* Returns a pointer to a vector storing the values of a doubled valued * Returns a pointer to a vector storing the values of a doubled valued
...@@ -170,7 +182,7 @@ namespace AMDiS { ...@@ -170,7 +182,7 @@ namespace AMDiS {
* Returns \ref lambda[a][b] which is the b-th coordinate entry of the a-th * Returns \ref lambda[a][b] which is the b-th coordinate entry of the a-th
* quadrature point * quadrature point
*/ */
inline double getLambda(int a,int b) const { inline double getLambda(int a, int b) const {
return (lambda ? (*lambda)[a][b] : 0.0); return (lambda ? (*lambda)[a][b] : 0.0);
}; };
...@@ -185,45 +197,10 @@ namespace AMDiS { ...@@ -185,45 +197,10 @@ namespace AMDiS {
/** \brief /** \brief
* Returns \ref lambda which is a VectorOfFixvecs<DimVec<double> >. * Returns \ref lambda which is a VectorOfFixvecs<DimVec<double> >.
*/ */
VectorOfFixVecs<DimVec<double> > *getLambda() const { return lambda; }; VectorOfFixVecs<DimVec<double> > *getLambda() const {
return lambda;
/** \brief };
* The function returns a pointer ptr to a vector of length
* \ref n_points storing the values of \f$ u_h \f$ at all
* quadrature points, i.e.
* \f[ ptr[l] = u_h(lambda[l]) \f] where
* l = 0, . . . , n_points - 1. vec is an optional memory pointer
*/
// const double *uhAtQp(const BasisFunction *basFcts,
// const double *uh_loc, double *vec) const;
/** \brief
* The function returns a pointer ptr to a vector of length
* \ref n_points WorldVectors storing \f$ \nabla u_h \f$ at all
* quadrature points, i.e.
* \f[ ptr[l][i] = u_{h,xi}(lambda[l]) \f]
* where l = 0, ... , n_points - 1, and i = 0, ... ,
* DIM_OF_WORLD - 1; vec is an optional memory pointer
*/
// const WorldVector<double> *grdUhAtQp(const BasisFunction *basFcts,
// const DimVec<WorldVector<double> >& Lambda,
// const double *uh_loc,
// WorldVector<double> *vec) const;
/** \brief
* The function returns a pointer ptr to a vector of length
* \ref n_points of WorldMatrices storing D2uh at all quadrature
* points, i.e.
* \f[ ptr[l][i][j] = u_{h,x_ix_j}(lambda[l]) \f]
* where l = 0, ... , n_points - 1, and i, j = 0, ... ,
* DIM_OF_WORLD - 1; vec is an optional memory pointer
*/
// const WorldMatrix<double> *D2UhAtQp(const BasisFunction *basFcts,
// const DimVec<WorldVector<double> >& Lambda,
// const double *uh_loc,
// WorldMatrix<double> *vec) const;
public: public:
/** \brief /** \brief
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment