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

element P1Mini + dg : update dgConservationLawPorous

parent 2b113127
No related branches found
No related tags found
No related merge requests found
......@@ -209,8 +209,9 @@
#define MSH_TRI_SUB 135
#define MSH_TET_SUB 136
#define MSH_TET_16 137
#define MSH_TRI_MINI 138
#define MSH_NUM_TYPE 137
#define MSH_NUM_TYPE 138
// Geometric entities
#define ENT_NONE 0
......
......@@ -5,6 +5,7 @@
#include "GmshDefines.h"
#include "GmshMessage.h"
#include "miniBasis.h"
#include "polynomialBasis.h"
#include "pyramidalBasis.h"
#include "pointsGenerators.h"
......@@ -25,25 +26,29 @@ const nodalBasis* BasisFactory::getNodalBasis(int tag)
}
// Get the parent type to see which kind of basis
// we want to create
int parentType = ElementType::ParentTypeFromTag(tag);
nodalBasis* F = NULL;
switch(parentType) {
case(TYPE_PNT):
case(TYPE_LIN):
case(TYPE_TRI):
case(TYPE_QUA):
case(TYPE_PRI):
case(TYPE_TET):
case(TYPE_HEX):
F = new polynomialBasis(tag);
break;
case(TYPE_PYR):
F = new pyramidalBasis(tag);
break;
default:
Msg::Error("Unknown type of element %d (in BasisFactory)", tag);
return NULL;
if (tag == MSH_TRI_MINI) {
F = new miniBasis();
}
else {
int parentType = ElementType::ParentTypeFromTag(tag);
switch(parentType) {
case(TYPE_PNT):
case(TYPE_LIN):
case(TYPE_TRI):
case(TYPE_QUA):
case(TYPE_PRI):
case(TYPE_TET):
case(TYPE_HEX):
F = new polynomialBasis(tag);
break;
case(TYPE_PYR):
F = new pyramidalBasis(tag);
break;
default:
Msg::Error("Unknown type of element %d (in BasisFactory)", tag);
return NULL;
}
}
std::pair<std::map<int, nodalBasis*>::const_iterator, bool> inserted;
......
......@@ -8,6 +8,7 @@ set(SRC
fullMatrix.cpp
BasisFactory.cpp
discreteFrechetDistance.cpp
miniBasis.cpp
nodalBasis.cpp
polynomialBasis.cpp
pyramidalBasis.cpp
......
#include "miniBasis.h"
#include "BasisFactory.h"
miniBasis::miniBasis()
{
type = MSH_TRI_MINI;
parentType = TYPE_TRI;
order = 3;
dimension = 2;
numFaces = 3;
serendip = false;
const nodalBasis &p1 = *BasisFactory::getNodalBasis(MSH_TRI_3);
closures = p1.closures;
fullClosures = p1.fullClosures;
for(size_t i = 0; i < fullClosures.size(); ++i) {
fullClosures[i].push_back(3);
}
closureRef = p1.closureRef;
points = p1.points;
points.resize(4, 2);
points(0, 0) = 0.; points(0, 1) = 0.;
points(1, 0) = 1.; points(1, 1) = 0.;
points(2, 0) = 0.; points(2, 1) = 1.;
points(3, 0) = 1./3; points(3, 1) = 1./3;
monomials.resize(6, 2);
monomials(0, 0) = 0.; monomials(0, 1) = 0.;
monomials(1, 0) = 1.; monomials(1, 1) = 0.;
monomials(2, 0) = 0.; monomials(2, 1) = 1.;
monomials(3, 0) = 1.; monomials(3, 1) = 1.;
monomials(4, 0) = 2.; monomials(4, 1) = 1.;
monomials(5, 0) = 1.; monomials(5, 1) = 2.;
coefficients.resize(4, 6);
coefficients.setAll(0.);
coefficients(0, 0) = 1.; coefficients(0, 1) = -1.; coefficients(0, 2) = -1.;
coefficients(1, 1) = 1.;
coefficients(2, 2) = 1.;
coefficients(3, 3) = 1.; coefficients(3, 4) = -1.; coefficients(3, 5) = -1.;
}
#ifndef _MINI_BASIS_H_
#define _MINI_BASIS_H_
#include "polynomialBasis.h"
class miniBasis : public polynomialBasis { // mini is NOT a real nodal basis but in GMSH, only the nodal basis have closure and mini have closure so...
public:
miniBasis();
};
#endif
......@@ -15,6 +15,7 @@ class nodalBasis {
bool serendip;
fullMatrix<double> points;
nodalBasis() {};
nodalBasis(int tag);
virtual ~nodalBasis() {}
......
......@@ -79,6 +79,7 @@ class polynomialBasis : public nodalBasis
fullMatrix<double> monomials;
fullMatrix<double> coefficients;
polynomialBasis() {};
polynomialBasis(int tag);
~polynomialBasis();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment