Skip to content
Snippets Groups Projects
Commit 05d79704 authored by Christophe Geuzaine's avatar Christophe Geuzaine
Browse files

don't crash of we try to display serendipity pyramids

parent 14940753
No related branches found
No related tags found
No related merge requests found
......@@ -355,7 +355,8 @@ class initMeshGRegion {
for(unsigned int i = 0; i < r->polyhedra.size(); i++)
numLP += 2 * r->polyhedra[i]->getNumEdges();
num += (12 * r->tetrahedra.size() + 24 * r->hexahedra.size() +
18 * r->prisms.size() + 16 * r->pyramids.size() + 10 * r->trihedra.size() + numLP) / 4;
18 * r->prisms.size() + 16 * r->pyramids.size() +
10 * r->trihedra.size() + numLP) / 4;
num = _estimateIfClipped(num);
if(CTX::instance()->mesh.explode != 1.) num *= 4;
if(_curved) num *= 2;
......@@ -370,7 +371,8 @@ class initMeshGRegion {
for(unsigned int i = 0; i < r->polyhedra.size(); i++)
numFP += r->polyhedra[i]->getNumFaces();
num += (4 * r->tetrahedra.size() + 12 * r->hexahedra.size() +
8 * r->prisms.size() + 6 * r->pyramids.size() + 4 * r->trihedra.size() + numFP) / 2;
8 * r->prisms.size() + 6 * r->pyramids.size() +
4 * r->trihedra.size() + numFP) / 2;
num = _estimateIfClipped(num);
if(CTX::instance()->mesh.explode != 1.) num *= 2;
if(_curved) num *= 4;
......
......@@ -8,10 +8,10 @@
#include "pyramidalBasis.h"
#include "pointsGenerators.h"
pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag)
pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag), bergot(0)
{
if (serendip) {
Msg::Error("Serendipity Pyramid not implemented");
Msg::Warning("Serendipity pyramid not implemented yet");
return;
}
......@@ -56,21 +56,16 @@ pyramidalBasis::pyramidalBasis(int tag) : nodalBasis(tag)
delete[] fval;
}
pyramidalBasis::~pyramidalBasis()
{
delete bergot;
if(bergot) delete bergot;
}
int pyramidalBasis::getNumShapeFunctions() const { return points.size1(); }
void pyramidalBasis::f(double u, double v, double w, double *val) const
{
if(!bergot) return;
const int N = bergot->size();
......@@ -83,13 +78,11 @@ void pyramidalBasis::f(double u, double v, double w, double *val) const
}
delete[] fval;
}
void pyramidalBasis::f(const fullMatrix<double> &coord, fullMatrix<double> &sf) const
{
if(!bergot) return;
const int N = bergot->size(), NPts = coord.size1();
......@@ -105,13 +98,11 @@ void pyramidalBasis::f(const fullMatrix<double> &coord, fullMatrix<double> &sf)
}
delete[] fval;
}
void pyramidalBasis::df(double u, double v, double w, double grads[][3]) const
{
if(!bergot) return;
const int N = bergot->size();
......@@ -128,13 +119,11 @@ void pyramidalBasis::df(double u, double v, double w, double grads[][3]) const
}
delete[] dfval;
}
void pyramidalBasis::df(const fullMatrix<double> &coord, fullMatrix<double> &dfm) const
{
if(!bergot) return;
const int N = bergot->size(), NPts = coord.size1();
......@@ -151,5 +140,4 @@ void pyramidalBasis::df(const fullMatrix<double> &coord, fullMatrix<double> &dfm
}
delete[] dfv;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment