Skip to content
Snippets Groups Projects
Commit d8dd74b9 authored by Sebastien Blaise's avatar Sebastien Blaise
Browse files

Added inner radius for hexahedrons

parent c3960e41
No related branches found
No related tags found
No related merge requests found
......@@ -2,12 +2,12 @@
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to <gmsh@geuz.org>.
#include <limits>
#include "MHexahedron.h"
#include "Numeric.h"
#include "Context.h"
#include "polynomialBasis.h"
#include "MQuadrangle.h"
int MHexahedron::getVolumeSign()
{
double mat[3][3];
......@@ -32,6 +32,17 @@ void MHexahedron::getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
*pts = getGQHPts(pOrder);
}
double MHexahedron::getInnerRadius()
{
//Only for vertically aligned elements (not inclined)
double innerRadius=std::numeric_limits<double>::max();
for (int i=0; i<getNumFaces(); i++){
MQuadrangle quad(getFace(i).getVertex(0), getFace(i).getVertex(1), getFace(i).getVertex(2), getFace(i).getVertex(3));
innerRadius=std::min(innerRadius,quad.getInnerRadius());
}
return innerRadius;
}
void MHexahedron::getFaceInfo(const MFace &face, int &ithFace, int &sign, int &rot) const
{
for (ithFace = 0; ithFace < 6; ithFace++){
......
......@@ -88,6 +88,7 @@ class MHexahedron : public MElement {
_v[faces_hexa(num, 2)],
_v[faces_hexa(num, 3)]);
}
virtual double getInnerRadius();
virtual void getFaceInfo (const MFace & face, int &ithFace, int &sign, int &rot)const;
virtual int getNumFacesRep(){ return 12; }
virtual void getFaceRep(int num, double *x, double *y, double *z, SVector3 *n)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment