Skip to content
Snippets Groups Projects
Commit fee0b8bc authored by Jonathan Lambrechts's avatar Jonathan Lambrechts
Browse files

dgGroupOfElements compilation ok

parent e0c8a2fe
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,7 @@ set(SRC ...@@ -10,6 +10,7 @@ set(SRC
elasticitySolver.cpp elasticitySolver.cpp
SElement.cpp SElement.cpp
eigenSolver.cpp eigenSolver.cpp
dgGroupOfElements.cpp
) )
file(GLOB HDR RELATIVE ${CMAKE_SOURCE_DIR}/Solver *.h) file(GLOB HDR RELATIVE ${CMAKE_SOURCE_DIR}/Solver *.h)
......
...@@ -199,7 +199,7 @@ void dgGroupOfFaces::createEdgeElements (const std::vector<MEdge> &topo_edges){ ...@@ -199,7 +199,7 @@ void dgGroupOfFaces::createEdgeElements (const std::vector<MEdge> &topo_edges){
} }
} }
} }
void dgGroupOfFace::init() { void dgGroupOfFaces::init(int pOrder) {
_fsFace = _faces[0]->getFunctionSpace (pOrder); _fsFace = _faces[0]->getFunctionSpace (pOrder);
_integration=dgGetIntegrationRule (_faces[0],pOrder); _integration=dgGetIntegrationRule (_faces[0],pOrder);
_redistribution = new fullMatrix<double> (_fsFace->coefficients.size1(),_integration->size1()); _redistribution = new fullMatrix<double> (_fsFace->coefficients.size1(),_integration->size1());
...@@ -208,7 +208,7 @@ void dgGroupOfFace::init() { ...@@ -208,7 +208,7 @@ void dgGroupOfFace::init() {
for (int j=0;j<_integration->size1();j++) { for (int j=0;j<_integration->size1();j++) {
_fsFace->f((*_integration)(j,0), (*_integration)(j,1), (*_integration)(j,2), f); _fsFace->f((*_integration)(j,0), (*_integration)(j,1), (*_integration)(j,2), f);
const double weight = (*_integration)(j,3); const double weight = (*_integration)(j,3);
for (int k=0;k<_fs.coefficients.size1();k++){ for (int k=0;k<_fsFace->coefficients.size1();k++){
(*_redistribution)(k,j) = f[j] * weight; (*_redistribution)(k,j) = f[j] * weight;
(*_collocation)(k,j) = f[k]; (*_collocation)(k,j) = f[k];
} }
...@@ -222,7 +222,7 @@ dgGroupOfFaces::dgGroupOfFaces (const std::vector<MFace> &topo_faces, ...@@ -222,7 +222,7 @@ dgGroupOfFaces::dgGroupOfFaces (const std::vector<MFace> &topo_faces,
_fsLeft(_left[0]->getFunctionSpace (pOrder)), _fsRight (_right[0]->getFunctionSpace (pOrder)) _fsLeft(_left[0]->getFunctionSpace (pOrder)), _fsRight (_right[0]->getFunctionSpace (pOrder))
{ {
createFaceElements (topo_faces); createFaceElements (topo_faces);
init(); init(pOrder);
} }
dgGroupOfFaces::dgGroupOfFaces (const std::vector<MEdge> &topo_edges, dgGroupOfFaces::dgGroupOfFaces (const std::vector<MEdge> &topo_edges,
...@@ -232,5 +232,5 @@ dgGroupOfFaces::dgGroupOfFaces (const std::vector<MEdge> &topo_edges, ...@@ -232,5 +232,5 @@ dgGroupOfFaces::dgGroupOfFaces (const std::vector<MEdge> &topo_edges,
_fsLeft(_left[0]->getFunctionSpace (pOrder)), _fsRight (_right[0]->getFunctionSpace (pOrder)) _fsLeft(_left[0]->getFunctionSpace (pOrder)), _fsRight (_right[0]->getFunctionSpace (pOrder))
{ {
createEdgeElements (topo_edges); createEdgeElements (topo_edges);
init(); init(pOrder);
} }
...@@ -27,7 +27,7 @@ public: ...@@ -27,7 +27,7 @@ public:
: _element(e), _solution(sol), _integration(integ), _gradients(sol) : _element(e), _solution(sol), _integration(integ), _gradients(sol)
{} {}
dgElement (MElement *e, const fullMatrix<double> &sol, const fullMatrix<double> &grads, const fullMatrix<double> &integ) dgElement (MElement *e, const fullMatrix<double> &sol, const fullMatrix<double> &grads, const fullMatrix<double> &integ)
: _element(e), _solution(sol), _integration(integ), _gradients(grad) : _element(e), _solution(sol), _integration(integ), _gradients(grads)
{} {}
}; };
...@@ -67,21 +67,22 @@ public: ...@@ -67,21 +67,22 @@ public:
virtual ~dgGroupOfElements (); virtual ~dgGroupOfElements ();
inline int getNbElements() const {return _elements.size();} inline int getNbElements() const {return _elements.size();}
inline int getNbFields() const {return _nbFields;} inline int getNbFields() const {return _nbFields;}
inline int getNbNodes() const {return _collocation.size1();} inline int getNbNodes() const {return _collocation->size1();}
inline int getNbIntegrationPoints() const {return _collocation.size2();} inline int getNbIntegrationPoints() const {return _collocation->size2();}
inline int getDimUVW () const {return _dimUVW;} inline int getDimUVW () const {return _dimUVW;}
inline int getDimXYZ () const {return _dimXYZ;} inline int getDimXYZ () const {return _dimXYZ;}
inline const MElement* getElement (int iElement) const {return _elements[iElement];} inline const MElement* getElement (int iElement) const {return _elements[iElement];}
inline const fullMatrix<double> & getIntegrationPointsMatrix () const {return *_integration;} inline const fullMatrix<double> & getIntegrationPointsMatrix () const {return *_integration;}
inline const fullMatrix<double> & getCollocationMatrix () const {return *_collocation;} inline const fullMatrix<double> & getCollocationMatrix () const {return *_collocation;}
inline const fullMatrix<double> & getRedistributionMatrix (int i) const {return *_redistribution[i];} inline const fullMatrix<double> & getFluxRedistributionMatrix (int i) const {return *_redistributionFluxes[i];}
inline const fullMatrix<double> & getSourceRedistributionMatrix () const {return *_redistributionSource;}
inline const fullMatrix<double> & getSolution () const {return *_solution;} inline const fullMatrix<double> & getSolution () const {return *_solution;}
inline const fullMatrix<double> & getGradientOfSolution () const {return *_gradSolution;} inline const fullMatrix<double> & getGradientOfSolution () const {return *_gradSolution;}
// get a proxy on the solution for element iElement // get a proxy on the solution for element iElement
inline fullMatrix<double> & getSolution (int iElement) const {return fullMatrix<double>(*_solution, iElement*_nbFields, _nbFields);} inline fullMatrix<double> getSolution (int iElement) const {return fullMatrix<double>(*_solution, iElement*_nbFields, _nbFields);}
inline const fullMatrix<double> & getResidual () const {return *_solution;} inline const fullMatrix<double> & getResidual () const {return *_solution;}
// get a proxy on the residual for element iElement // get a proxy on the residual for element iElement
inline fullMatrix<double> & getResidual (int iElement) const {return fullMatrix<double>(*_residual, iElement*_nbFields, _nbFields);} inline fullMatrix<double> getResidual (int iElement) const {return fullMatrix<double>(*_residual, iElement*_nbFields, _nbFields);}
inline double getDetJ (int iElement, int iGaussPoint) const {return (*_mapping)(iElement, 10*iGaussPoint + 9);} inline double getDetJ (int iElement, int iGaussPoint) const {return (*_mapping)(iElement, 10*iGaussPoint + 9);}
inline double getInvJ (int iElement, int iGaussPoint, int i, int j) const {return (*_mapping)(iElement, 10*iGaussPoint + i + 3*j);} inline double getInvJ (int iElement, int iGaussPoint, int i, int j) const {return (*_mapping)(iElement, 10*iGaussPoint + i + 3*j);}
inline fullMatrix<double> getMapping (int iElement) const {return fullMatrix<double>(*_mapping, iElement, 1);} inline fullMatrix<double> getMapping (int iElement) const {return fullMatrix<double>(*_mapping, iElement, 1);}
...@@ -126,7 +127,7 @@ class dgGroupOfFaces { ...@@ -126,7 +127,7 @@ class dgGroupOfFaces {
// redistribution matrices \psi_i (GP_j) * weight_j // redistribution matrices \psi_i (GP_j) * weight_j
fullMatrix<double> *_redistribution; fullMatrix<double> *_redistribution;
//common part of the 3 constructors //common part of the 3 constructors
void init(); void init(int pOrder);
public: public:
dgGroupOfFaces (const std::vector<MFace> &faces, dgGroupOfFaces (const std::vector<MFace> &faces,
const std::vector<MElement*> &l, const std::vector<MElement*> &l,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment