diff --git a/FunctionSpace/BasisGenerator.h b/FunctionSpace/BasisGenerator.h index 1a65f4b5eb9d7653a933c632ae7d1a1091e75313..84508593340d23b106e32067c67d89443a3f4054 100644 --- a/FunctionSpace/BasisGenerator.h +++ b/FunctionSpace/BasisGenerator.h @@ -6,10 +6,10 @@ /** @class BasisGenerator - @brief A bunch of class method to generate a Basis - - A BasisGenerator is a bunch of @em class - methods to generate a Basis. + @brief A bunch of class method to generate a Local Basis + + A BasisGenerator is a bunch of @em class + methods to generate a Local Basis (BasisLocal). @note A BasisGenerator got @em only @em class @em methods, @@ -21,15 +21,15 @@ class BasisGenerator{ BasisGenerator(void); ~BasisGenerator(void); - static BasisLocal* generate(unsigned int elementType, - unsigned int basisType, + static BasisLocal* generate(unsigned int elementType, + unsigned int basisType, unsigned int order, std::string family); - - static BasisLocal* generate(unsigned int elementType, - unsigned int basisType, + + static BasisLocal* generate(unsigned int elementType, + unsigned int basisType, unsigned int order); - + static BasisLocal* linHierarchicalGen(unsigned int basisType, unsigned int order); static BasisLocal* triHierarchicalGen(unsigned int basisType, unsigned int order); static BasisLocal* quaHierarchicalGen(unsigned int basisType, unsigned int order); @@ -37,13 +37,13 @@ class BasisGenerator{ static BasisLocal* hexHierarchicalGen(unsigned int basisType, unsigned int order); private: - static BasisLocal* generateHierarchical(unsigned int elementType, - unsigned int basisType, + static BasisLocal* generateHierarchical(unsigned int elementType, + unsigned int basisType, unsigned int order); - - static BasisLocal* generateLagrange(unsigned int elementType, - unsigned int basisType, - unsigned int order); + + static BasisLocal* generateLagrange(unsigned int elementType, + unsigned int basisType, + unsigned int order); }; @@ -70,7 +70,7 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, of the requested family - @return Returns a @em pointer to a newly + @return Returns a @em pointer to a newly @em instantiated Basis @note Element types are: @@ -87,10 +87,10 @@ class BasisGenerator{ @li @c 3 for 3-Form @note Families are: - @li @c hierarchical for + @li @c hierarchical for <a href="http://www.hpfem.jku.at/publications/szthesis.pdf">Zaglmayr's</a> Basis Functions - @li @c lagrange for Lagrange's Basis Functions + @li @c lagrange for Lagrange's Basis Functions ** @fn BasisGenerator::generate(unsigned int, unsigned int, unsigned int) @@ -99,10 +99,10 @@ class BasisGenerator{ @param basisType The Basis type @param order The order or the requested Basis - Same as + Same as BasisGenerator::generate(@c elementType, @c basisType, @c order, @c hierarchical) - @return Returns a @em pointer to a newly + @return Returns a @em pointer to a newly @em instantiated Basis ** @@ -112,8 +112,8 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, with a @em Line for support - - @return Returns a @em pointer to a newly + + @return Returns a @em pointer to a newly @em instantiated Basis @note Basis types are: @@ -131,8 +131,8 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, with a @em Triangle for support - - @return Returns a @em pointer to a newly + + @return Returns a @em pointer to a newly @em instantiated Basis @note Basis types are: @@ -151,7 +151,7 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, with a @em Quadrangle for support - @return Returns a @em pointer to a newly + @return Returns a @em pointer to a newly @em instantiated Basis @note Basis types are: @@ -169,8 +169,8 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, with a @em Tetrahedron for support - - @return Returns a @em pointer to a newly + + @return Returns a @em pointer to a newly @em instantiated Basis @note Basis types are: @@ -189,7 +189,7 @@ class BasisGenerator{ This method will @em instanciate the requested Basis, with a @em Hexahedron for support - @return Returns a @em pointer to a newly + @return Returns a @em pointer to a newly @em instantiated Basis @note Basis types are: @@ -206,12 +206,12 @@ class BasisGenerator{ // Inline Functions // ////////////////////// -inline BasisLocal* BasisGenerator::generate(unsigned int elementType, - unsigned int basisType, +inline BasisLocal* BasisGenerator::generate(unsigned int elementType, + unsigned int basisType, unsigned int order){ - - return BasisGenerator::generate(elementType, - basisType, + + return BasisGenerator::generate(elementType, + basisType, order, "hierarchical"); } diff --git a/FunctionSpace/FunctionSpace.cpp b/FunctionSpace/FunctionSpace.cpp index 35144db255fa2656d36c65633ba09ed6efbb652c..0391d6d0fa30317d23bb6f8a91a27872be807922 100644 --- a/FunctionSpace/FunctionSpace.cpp +++ b/FunctionSpace/FunctionSpace.cpp @@ -14,7 +14,10 @@ FunctionSpace::FunctionSpace(void){ FunctionSpace::~FunctionSpace(void){ // Basis // - delete localBasis; + for(unsigned int i = 0; i < nBasis; i++) + delete (*basis)[i]; + + delete basis; // Dof // if(dof){ @@ -34,7 +37,7 @@ FunctionSpace::~FunctionSpace(void){ delete (*group)[i]; delete group; } - + // Element To GoD // if(eToGod) delete eToGod; @@ -55,28 +58,29 @@ void FunctionSpace::build(const GroupOfElement& goe, int nVertex = myElement.getNumPrimaryVertices(); int nEdge = myElement.getNumEdges(); int nFace = myElement.getNumFaces(); - + // Init Struct // - type = basisType; - localBasis = BasisGenerator::generate(elementType, - basisType, + nBasis = 1; + basis = new vector<const Basis*>(nBasis); + (*basis)[0] = BasisGenerator::generate(elementType, + basisType, order, "hierarchical"); - + // Number of *Per* Entity functions // - fPerVertex = localBasis->getNVertexBased() / nVertex; + fPerVertex = (*basis)[0]->getNVertexBased() / nVertex; // NB: fPreVertex = 0 *or* 1 if(nEdge) - fPerEdge = localBasis->getNEdgeBased() / nEdge; + fPerEdge = (*basis)[0]->getNEdgeBased() / nEdge; else fPerEdge = 0; if(nFace) - fPerFace = localBasis->getNFaceBased() / nFace; + fPerFace = (*basis)[0]->getNFaceBased() / nFace; else - fPerFace = 0; + fPerFace = 0; - fPerCell = localBasis->getNCellBased(); // We always got 1 cell + fPerCell = (*basis)[0]->getNCellBased(); // We always got 1 cell // Build Dof // buildDof(); @@ -88,10 +92,10 @@ void FunctionSpace::buildDof(void){ const vector<const MElement*>& element = goe->getAll(); // Init Struct // - dof = new set<const Dof*, DofComparator>; + dof = new set<const Dof*, DofComparator>; group = new vector<GroupOfDof*>(nElement); - eToGod = new map<const MElement*, - const GroupOfDof*, + eToGod = new map<const MElement*, + const GroupOfDof*, ElementComparator>; // Create Dofs // @@ -101,7 +105,7 @@ void FunctionSpace::buildDof(void){ unsigned int nDof = myDof.size(); // Create new GroupOfDof - GroupOfDof* god = new GroupOfDof(nDof, *(element[i])); + GroupOfDof* god = new GroupOfDof(nDof, *(element[i])); (*group)[i] = god; // Add Dof @@ -121,87 +125,79 @@ void FunctionSpace::insertDof(Dof& d, GroupOfDof* god){ // Try to insert Dof // pair<set<const Dof*, DofComparator>::iterator, bool> p = dof->insert(tmp); - + // If insertion is OK (Dof 'd' didn't exist) // // --> Add new Dof in GoD if(p.second) god->add(*tmp); - + // If insertion failed (Dof 'd' already exists) // // --> delete 'd' and add existing Dof in GoD else{ - delete tmp; + delete tmp; god->add(*(*(p.first))); } } -vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{ +vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{ // Const_Cast // MElement& element = const_cast<MElement&>(elem); // Get Element Data // - const int nVertex = element.getNumPrimaryVertices(); - const int nEdge = element.getNumEdges(); - const int nFace = element.getNumFaces(); + const unsigned int nVertex = element.getNumPrimaryVertices(); + const unsigned int nEdge = element.getNumEdges(); + const unsigned int nFace = element.getNumFaces(); vector<MVertex*> vertex(nVertex); vector<MEdge> edge(nEdge); vector<MFace> face(nFace); - for(int i = 0; i < nVertex; i++) + for(unsigned int i = 0; i < nVertex; i++) vertex[i] = element.getVertex(i); - for(int i = 0; i < nEdge; i++) + for(unsigned int i = 0; i < nEdge; i++) edge[i] = element.getEdge(i); - - for(int i = 0; i < nFace; i++) + + for(unsigned int i = 0; i < nFace; i++) face[i] = element.getFace(i); - - // Get FunctionSpace Data for this Element // - const int nFVertex = getNFunctionPerVertex(element); - const int nFEdge = getNFunctionPerEdge(element); - const int nFFace = getNFunctionPerFace(element); - const int nFCell = getNFunctionPerCell(element); // Create Dof // - const int nDofVertex = nFVertex * nVertex; - const int nDofEdge = nFEdge * nEdge; - const int nDofFace = nFFace * nFace; - const int nDofCell = nFCell; - - int nDof = - nDofVertex + nDofEdge + nDofFace + nDofCell; + unsigned int nDof = + fPerVertex * nVertex + + fPerEdge * nEdge + + fPerFace * nFace + + fPerCell; vector<Dof> myDof(nDof); - int it = 0; - + unsigned int it = 0; + // Add Vertex Based Dof // - for(int i = 0; i < nVertex; i++){ - for(int j = 0; j < nFVertex; j++){ + for(unsigned int i = 0; i < nVertex; i++){ + for(unsigned int j = 0; j < fPerVertex; j++){ myDof[it].setDof(mesh->getGlobalId(*vertex[i]), j); it++; } } - + // Add Edge Based Dof // - for(int i = 0; i < nEdge; i++){ - for(int j = 0; j < nFEdge; j++){ + for(unsigned int i = 0; i < nEdge; i++){ + for(unsigned int j = 0; j < fPerEdge; j++){ myDof[it].setDof(mesh->getGlobalId(edge[i]), j); it++; } } - + // Add Face Based Dof // - for(int i = 0; i < nFace; i++){ - for(int j = 0; j < nFFace; j++){ + for(unsigned int i = 0; i < nFace; i++){ + for(unsigned int j = 0; j < fPerFace; j++){ myDof[it].setDof(mesh->getGlobalId(face[i]), j); it++; } } - + // Add Cell Based Dof // - for(int j = 0; j < nFCell; j++){ + for(unsigned int j = 0; j < fPerCell; j++){ myDof[it].setDof(mesh->getGlobalId(element), j); it++; } @@ -210,13 +206,13 @@ vector<Dof> FunctionSpace::getKeys(const MElement& elem) const{ } const GroupOfDof& FunctionSpace::getGoDFromElement(const MElement& element) const{ - const map<const MElement*, const GroupOfDof*, ElementComparator>::iterator it = + const map<const MElement*, const GroupOfDof*, ElementComparator>::iterator it = eToGod->find(&element); if(it == eToGod->end()) - throw + throw Exception("Their is no GroupOfDof associated with the given MElement"); else - return *(it->second); + return *(it->second); } diff --git a/FunctionSpace/FunctionSpace.h b/FunctionSpace/FunctionSpace.h index 60fdc83a15e821e5ada6ee13aa8f11dae0710368..f06ebf765636870f6c783e5a6b12e15e605eac04 100644 --- a/FunctionSpace/FunctionSpace.h +++ b/FunctionSpace/FunctionSpace.h @@ -4,7 +4,7 @@ #include <map> #include <vector> -#include "BasisLocal.h" +#include "Basis.h" #include "Comparators.h" #include "Dof.h" @@ -44,12 +44,15 @@ class FunctionSpace{ const GroupOfElement* goe; // Basis // - const BasisLocal* localBasis; - unsigned int fPerVertex; - unsigned int fPerEdge; - unsigned int fPerFace; - unsigned int fPerCell; - unsigned int type; + std::vector<const Basis*>* basis; + unsigned int nBasis; + unsigned int fPerVertex; + unsigned int fPerEdge; + unsigned int fPerFace; + unsigned int fPerCell; + + // Scalar Field ? // + bool scalar; // Dofs // std::set<const Dof*, DofComparator>* dof; @@ -61,16 +64,14 @@ class FunctionSpace{ public: virtual ~FunctionSpace(void); + const std::vector<const Basis*>& getBasis(const MElement& element) const; + const Basis& getBasis(unsigned int i) const; + unsigned int getNBasis(void) const; + const GroupOfElement& getSupport(void) const; unsigned int getOrder(void) const; - unsigned int getType(void) const; bool isScalar(void) const; - unsigned int getNFunctionPerVertex(const MElement& element) const; - unsigned int getNFunctionPerEdge(const MElement& element) const; - unsigned int getNFunctionPerFace(const MElement& element) const; - unsigned int getNFunctionPerCell(const MElement& element) const; - std::vector<Dof> getKeys(const MElement& element) const; std::vector<Dof> getKeys(const MVertex& vertex) const; std::vector<Dof> getKeys(const MEdge& edge) const; @@ -81,9 +82,6 @@ class FunctionSpace{ const GroupOfDof& getGoDFromElement(const MElement& element) const; - unsigned int getNOrientation(void) const; - unsigned int getOrientation(const MElement& element) const; - unsigned int dofNumber(void) const; unsigned int groupNumber(void) const; @@ -116,47 +114,10 @@ class FunctionSpace{ FunctionSpace ** - @fn FunctionSpace::getOrder - @return Return the @em order - of this FunctionSpace - ** - - @fn FunctionSpace::getType - @return Return the @em type of - the Basis functions composing - this Function Space. - @see Basis::getType() - ** - @fn FunctionSpace::isScalar @return Returns: @li @c true, if this FunstionSpace is scalar @li @c flase, otherwise - @see Basis::isScalar() - ** - - @fn FunctionSpace::getNFunctionPerVertex - @param element A MElement of the support - @return Returns the number of @em Vertex Based - Basis Functions, defined on the given element - ** - - @fn FunctionSpace::getNFunctionPerEdge - @param element A MElement of the support - @return Returns the number of @em Edge Based - Basis Functions, defined on the given element - ** - - @fn FunctionSpace::getNFunctionPerFace - @param element A MElement of the support - @return Returns the number of @em Face Based - Basis Functions, defined on the given element - ** - - @fn FunctionSpace::getNFunctionPerCell - @param element A MElement of the support - @return Returns the number of @em Cell Based - Basis Functions, defined on the given element ** @fn vector<Dof> FunctionSpace::getKeys(const MElement& element) const @@ -198,20 +159,6 @@ class FunctionSpace{ an Exception is thrown ** - @fn FunctionSpace::getNOrientation - @return Returns the number of - @em orientations of the - FunctionSpace reference space - @todo Multiple basis - ** - - @fn FunctionSpace::getOrientation - @param element A MElement - @return Returns a number charaterizing - the @em orientation of the given element - @todo Multiple basis - ** - @fn FunctionSpace::dofNumber @return Returns the number of Dof%s given by FunctionSpace::getAllDofs() @@ -228,44 +175,30 @@ class FunctionSpace{ // Inline Functions // ////////////////////// -inline const GroupOfElement& FunctionSpace::getSupport(void) const{ - return *goe; -} - -inline unsigned int FunctionSpace::getOrder(void) const{ - return (unsigned int)(localBasis->getOrder()); +inline const std::vector<const Basis*>& +FunctionSpace::getBasis(const MElement& element) const{ + return *basis; } -inline unsigned int FunctionSpace::getType(void) const{ - return type; -} - -inline bool FunctionSpace::isScalar(void) const{ - return localBasis->isScalar(); +inline const Basis& FunctionSpace::getBasis(unsigned int i) const{ + return *(*basis)[i]; } -inline unsigned int FunctionSpace::getNFunctionPerVertex(const MElement& element) const{ - return fPerVertex; +inline unsigned int FunctionSpace::getNBasis(void) const{ + return nBasis; } -inline unsigned int FunctionSpace::getNFunctionPerEdge(const MElement& element) const{ - return fPerEdge; -} - -inline unsigned int FunctionSpace::getNFunctionPerFace(const MElement& element) const{ - return fPerFace; -} - -inline unsigned int FunctionSpace::getNFunctionPerCell(const MElement& element) const{ - return fPerCell; +inline const GroupOfElement& FunctionSpace::getSupport(void) const{ + return *goe; } - -inline unsigned int FunctionSpace::getNOrientation(void) const{ - return localBasis->getNOrientation(); +#include "Exception.h" +inline unsigned int FunctionSpace::getOrder(void) const{ + throw Exception("Remove me!"); + return (unsigned int)((*basis)[0]->getOrder()); } -inline unsigned int FunctionSpace::getOrientation(const MElement& element) const{ - return localBasis->getOrientation(element); +inline bool FunctionSpace::isScalar(void) const{ + return scalar; } inline unsigned int FunctionSpace::dofNumber(void) const{ diff --git a/FunctionSpace/FunctionSpaceEdge.cpp b/FunctionSpace/FunctionSpaceEdge.cpp index aedef910a2538bd5143ad17f29107784def8e685..e9000069a11aac2af15306e47db256228adcdc81 100644 --- a/FunctionSpace/FunctionSpaceEdge.cpp +++ b/FunctionSpace/FunctionSpaceEdge.cpp @@ -36,7 +36,7 @@ interpolate(const MElement& element, // Get Basis Functions // fullMatrix<double>* fun = - localBasis->getFunctions(element, uvw[0], uvw[1], uvw[2]); + (*basis)[0]->getFunctions(element, uvw[0], uvw[1], uvw[2]); const unsigned int nFun = fun->size1(); @@ -73,7 +73,7 @@ interpolateInRefSpace(const MElement& element, // Get Basis Functions // fullMatrix<double>* fun = - localBasis->getFunctions(element, uvw(0), uvw(1), uvw(2)); + (*basis)[0]->getFunctions(element, uvw(0), uvw(1), uvw(2)); const unsigned int nFun = fun->size1(); diff --git a/FunctionSpace/FunctionSpaceNode.cpp b/FunctionSpace/FunctionSpaceNode.cpp index 2f3c4a5335a79530642c0bd4ed8dbedd1ecb0d74..0ad52444ce44091d1cf3d01d86f1c89dd8c39e0d 100644 --- a/FunctionSpace/FunctionSpaceNode.cpp +++ b/FunctionSpace/FunctionSpaceNode.cpp @@ -31,7 +31,7 @@ interpolate(const MElement& element, // Get Basis Functions // fullMatrix<double>* fun = - localBasis->getFunctions(element, uvw[0], uvw[1], uvw[2]); + (*basis)[0]->getFunctions(element, uvw[0], uvw[1], uvw[2]); const unsigned int nFun = fun->size1(); @@ -53,7 +53,7 @@ interpolateInRefSpace(const MElement& element, // Get Basis Functions // fullMatrix<double>* fun = - localBasis->getFunctions(element, uvw(0), uvw(1), uvw(2)); + (*basis)[0]->getFunctions(element, uvw(0), uvw(1), uvw(2)); const unsigned int nFun = fun->size1(); diff --git a/FunctionSpace/FunctionSpaceScalar.cpp b/FunctionSpace/FunctionSpaceScalar.cpp index e7b173dc8d17adfb175b5f5f0fdba0ab346a157c..ea56e27434709722f5fc718b1b505635dac5044e 100644 --- a/FunctionSpace/FunctionSpaceScalar.cpp +++ b/FunctionSpace/FunctionSpaceScalar.cpp @@ -1,6 +1,7 @@ #include "FunctionSpaceScalar.h" FunctionSpaceScalar::FunctionSpaceScalar(void){ + scalar = true; } FunctionSpaceScalar::~FunctionSpaceScalar(void){ diff --git a/FunctionSpace/FunctionSpaceScalar.h b/FunctionSpace/FunctionSpaceScalar.h index 7f2a9ad176f403441f780120dbd9c35e915e9f3b..e52ec5de9f29a8d00f2908f10ae1f519063406a0 100644 --- a/FunctionSpace/FunctionSpaceScalar.h +++ b/FunctionSpace/FunctionSpaceScalar.h @@ -1,7 +1,6 @@ #ifndef _FUNCTIONSPACESCALAR_H_ #define _FUNCTIONSPACESCALAR_H_ -#include "Exception.h" #include "FunctionSpace.h" /** @@ -35,21 +34,6 @@ class FunctionSpaceScalar : public FunctionSpace{ const std::vector<double>& coef, const fullVector<double>& uvw) const = 0; - void preEvaluateLocalFunctions(const fullMatrix<double>& point) const; - void preEvaluateGradLocalFunctions(const fullMatrix<double>& point) const; - - const fullMatrix<double>& - getEvaluatedLocalFunctions(const MElement& element) const; - - const fullMatrix<double>& - getEvaluatedGradLocalFunctions(const MElement& element) const; - - const fullMatrix<double>& - getEvaluatedLocalFunctions(unsigned int orientation) const; - - const fullMatrix<double>& - getEvaluatedGradLocalFunctions(unsigned int orientation) const; - protected: FunctionSpaceScalar(void); }; @@ -96,124 +80,6 @@ class FunctionSpaceScalar : public FunctionSpace{ If the given coordinate are not in the given @c element @em Bad @em Things may happend ---> check - ** - - @fn FunctionSpaceScalar::preEvaluateLocalFunctions - @param point A set of @c 3D Points - - Precomputes the Local Functions of this FunctionSpace - at the given Points. - - @note Each row of @c point is a new Point, - and each column is a coordinate (for a total of - 3 columns) - ** - - @fn FunctionSpaceScalar::preEvaluateGradLocalFunctions - @param point A set of @c 3D Points - - Precomputes the @em Gradient of the Local Functions - of this FunctionSpace at the given Points. - - @note Each row of @c point is a new Point, - and each column is a coordinate (for a total of - 3 columns) - ** - - @fn FunctionSpaceScalar::getEvaluatedLocalFunctions(const MElement&) const - @param element A MElement - @return Returns the @em values of the @em precomputed - Basis Functions associated - to the given element (with correct @em closure) - - @note - The returned values @em must be computed by - FunctionSpaceScalar::preEvaluateLocalFunctions(), - if not an Exception will be thrown - ** - - @fn FunctionSpaceScalar::getEvaluatedGradLocalFunctions(const MElement&) const - @param element A MElement - @return Returns the @em values of the @em precomputed - @em Gradients of the Basis Functions associated - to the given element (with correct @em closure) - - @note - The returned values @em must be computed by - FunctionSpaceScalar::preEvaluateGradLocalFunctions(), - if not an Exception will be thrown - ** - - @fn FunctionSpaceScalar::getEvaluatedLocalFunctions(unsigned int) const - @param orientation A number definig the orientation of the reference space - @return Same as - FunctionSpaceScalar::getEvaluatedLocalFunctions(const MElement&) const - but the orientation is not given by en element but by a number (@c orientation) - ** - - @fn FunctionSpaceScalar::getEvaluatedGradLocalFunctions(unsigned int) const - @param orientation A number definig the orientation of the reference space - @return Same as - FunctionSpaceScalar::getEvaluatedGradLocalFunctions(const MElement&) const - but the orientation is not given by en element but by a number (@c orientation) */ -////////////////////// -// Inline Functions // -////////////////////// - -inline void FunctionSpaceScalar:: -preEvaluateLocalFunctions(const fullMatrix<double>& point) const{ - localBasis->preEvaluateFunctions(point); -} - -inline void FunctionSpaceScalar:: -preEvaluateGradLocalFunctions(const fullMatrix<double>& point) const{ - localBasis->preEvaluateDerivatives(point); -} - -inline const fullMatrix<double>& -FunctionSpaceScalar::getEvaluatedLocalFunctions(const MElement& element) const{ - try{ - return localBasis->getPreEvaluatedFunctions(element); - } - - catch(Exception& any){ - throw Exception("Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceScalar::getEvaluatedGradLocalFunctions(const MElement& element) const{ - try{ - return localBasis->getPreEvaluatedDerivatives(element); - } - - catch(Exception& any){ - throw Exception("Gradient of Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceScalar::getEvaluatedLocalFunctions(unsigned int orientation) const{ - try{ - return localBasis->getPreEvaluatedFunctions(orientation); - } - - catch(Exception& any){ - throw Exception("Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceScalar::getEvaluatedGradLocalFunctions(unsigned int orientation) const{ - try{ - return localBasis->getPreEvaluatedDerivatives(orientation); - } - - catch(Exception& any){ - throw Exception("Gradient of Local Basis Functions not PreEvaluated"); - } -} - #endif diff --git a/FunctionSpace/FunctionSpaceVector.cpp b/FunctionSpace/FunctionSpaceVector.cpp index e3686be909e63b51e2c1bf21798a18e957fa1a1e..b4a3784290a30c5613212e968f082b1823e6b12f 100644 --- a/FunctionSpace/FunctionSpaceVector.cpp +++ b/FunctionSpace/FunctionSpaceVector.cpp @@ -1,6 +1,7 @@ #include "FunctionSpaceVector.h" FunctionSpaceVector::FunctionSpaceVector(void){ + scalar = false; } FunctionSpaceVector::~FunctionSpaceVector(void){ diff --git a/FunctionSpace/FunctionSpaceVector.h b/FunctionSpace/FunctionSpaceVector.h index 9bc3d0680eb981e9bc9a80008fa711937bae2d19..dd0b2e770574e6abcdd14f19ff49816e51eab091 100644 --- a/FunctionSpace/FunctionSpaceVector.h +++ b/FunctionSpace/FunctionSpaceVector.h @@ -35,28 +35,6 @@ class FunctionSpaceVector : public FunctionSpace{ const std::vector<double>& coef, const fullVector<double>& uvw) const = 0; - void preEvaluateLocalFunctions(const fullMatrix<double>& point) const; - void preEvaluateCurlLocalFunctions(const fullMatrix<double>& point) const; - void preEvaluateDivLocalFunctions(const fullMatrix<double>& point) const; - - const fullMatrix<double>& - getEvaluatedLocalFunctions(const MElement& element) const; - - const fullMatrix<double>& - getEvaluatedCurlLocalFunctions(const MElement& element) const; - - const fullMatrix<double>& - getEvaluatedDivLocalFunctions(const MElement& element) const; - - const fullMatrix<double>& - getEvaluatedLocalFunctions(unsigned int orientation) const; - - const fullMatrix<double>& - getEvaluatedCurlLocalFunctions(unsigned int orientation) const; - - const fullMatrix<double>& - getEvaluatedDivLocalFunctions(unsigned int orientation) const; - protected: FunctionSpaceVector(void); }; @@ -103,181 +81,6 @@ class FunctionSpaceVector : public FunctionSpace{ If the given coordinate are not in the given @c element @em Bad @em Things may happend ---> check - ** - - @fn FunctionSpaceVector::preEvaluateLocalFunctions - @param point A set of @c 3D Points - - Precomputes the Local Functions of this FunctionSpace - at the given Points. - - @note Each row of @c point is a new Point, - and each column is a coordinate (for a total of - 3 columns) - ** - - @fn FunctionSpaceVector::preEvaluateCurlLocalFunctions - @param point A set of @c 3D Points - - Precomputes the @em Curl of the Local Functions - of this FunctionSpace at the given Points. - - @note Each row of @c point is a new Point, - and each column is a coordinate (for a total of - 3 columns) - ** - - @fn FunctionSpaceVector::preEvaluateDivLocalFunctions - @param point A set of @c 3D Points - - Precomputes the @em Divergence of the Local Functions - of this FunctionSpace at the given Points. - - @note Each row of @c point is a new Point, - and each column is a coordinate (for a total of - 3 columns) - ** - - @fn FunctionSpaceVector::getEvaluatedLocalFunctions(const MElement&) const - @param element A MElement - @return Returns the @em values of the @em precomputed - Basis Functions associated - to the given element (with correct @em closure) - - @note - The returned values @em must be computed by - FunctionSpaceVector::preEvaluateLocalFunctions(), - if not an Exception will be thrown - ** - - @fn FunctionSpaceVector::getEvaluatedCurlLocalFunctions(const MElement&) const - @param element A MElement - @return Returns the @em values of the @em precomputed - @em Curls of the Basis Functions associated - to the given element (with correct @em closure) - - @note - The returned values @em must be computed by - FunctionSpaceVector::preEvaluateCurlLocalFunctions(), - if not an Exception will be thrown - ** - - @fn FunctionSpaceVector::getEvaluatedDivLocalFunctions(const MElement&) const - @param element A MElement - @return Returns the @em values of the @em precomputed - @em Divergences of the Basis Functions associated - to the given element (with correct @em closure) - - @note - The returned values @em must be computed by - FunctionSpaceVector::preEvaluateDivLocalFunctions(), - if not an Exception will be thrown - ** - - @fn FunctionSpaceVector::getEvaluatedLocalFunctions(unsigned int) const - @param orientation A number definig the orientation of the reference space - @return Same as - FunctionSpaceVector::getEvaluatedLocalFunctions(const MElement&) const - but the orientation is not given by en element but by a number (@c orientation) - ** - - @fn FunctionSpaceVector::getEvaluatedCurlLocalFunctions(unsigned int) const - @param orientation A number definig the orientation of the reference space - @return Same as - FunctionSpaceVector::getEvaluatedCurlLocalFunctions(const MElement&) const - but the orientation is not given by en element but by a number (@c orientation) - ** - - @fn FunctionSpaceVector::getEvaluatedDivLocalFunctions(unsigned int) const - @param orientation A number definig the orientation of the reference space - @return Same as - FunctionSpaceVector::getEvaluatedDivLocalFunctions(const MElement&) const - but the orientation is not given by en element but by a number (@c orientation) */ -////////////////////// -// Inline Functions // -////////////////////// - -inline void FunctionSpaceVector:: -preEvaluateLocalFunctions(const fullMatrix<double>& point) const{ - localBasis->preEvaluateFunctions(point); -} - -inline void FunctionSpaceVector:: -preEvaluateCurlLocalFunctions(const fullMatrix<double>& point) const{ - localBasis->preEvaluateDerivatives(point); -} - -inline void FunctionSpaceVector:: -preEvaluateDivLocalFunctions(const fullMatrix<double>& point) const{ - localBasis->preEvaluateDerivatives(point); -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedLocalFunctions(const MElement& element) const{ - try{ - return localBasis->getPreEvaluatedFunctions(element); - } - - catch(Exception& any){ - throw Exception("Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedCurlLocalFunctions(const MElement& element) const{ - try{ - return localBasis->getPreEvaluatedDerivatives(element); - } - - catch(Exception& any){ - throw Exception("Curl of Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedDivLocalFunctions(const MElement& element) const{ - try{ - return localBasis->getPreEvaluatedFunctions(element); - } - - catch(Exception& any){ - throw Exception("Divergence of Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedLocalFunctions(unsigned int orientation) const{ - try{ - return localBasis->getPreEvaluatedFunctions(orientation); - } - - catch(Exception& any){ - throw Exception("Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedCurlLocalFunctions(unsigned int orientation) const{ - try{ - return localBasis->getPreEvaluatedDerivatives(orientation); - } - - catch(Exception& any){ - throw Exception("Curl of Local Basis Functions not PreEvaluated"); - } -} - -inline const fullMatrix<double>& -FunctionSpaceVector::getEvaluatedDivLocalFunctions(unsigned int orientation) const{ - try{ - return localBasis->getPreEvaluatedFunctions(orientation); - } - - catch(Exception& any){ - throw Exception("Divergence of Local Basis Functions not PreEvaluated"); - } -} - #endif