Select Git revision
CreateFile.cpp
Forked from
gmsh / gmsh
Source project has a limited visibility.
-
Christophe Geuzaine authored
- ParseString can now run in the current model directory (useful when parsing things with relative filenames) - New View.Time option to select the timestep according to the time value
Christophe Geuzaine authored- ParseString can now run in the current model directory (useful when parsing things with relative filenames) - New View.Time option to select the timestep according to the time value
MElement.cpp 63.79 KiB
// Gmsh - Copyright (C) 1997-2016 C. Geuzaine, J.-F. Remacle
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <gmsh@onelab.info>.
#include <stdlib.h>
#include <math.h>
#include <limits>
#include "GmshConfig.h"
#include "GmshMessage.h"
#include "GModel.h"
#include "MElement.h"
#include "MPoint.h"
#include "MLine.h"
#include "MTriangle.h"
#include "MQuadrangle.h"
#include "MTetrahedron.h"
#include "MHexahedron.h"
#include "MPrism.h"
#include "MPyramid.h"
#include "MTrihedron.h"
#include "MElementCut.h"
#include "MSubElement.h"
#include "GEntity.h"
#include "StringUtils.h"
#include "Numeric.h"
#include "CondNumBasis.h"
#include "Context.h"
#include "qualityMeasuresJacobian.h"
#define SQU(a) ((a)*(a))
double MElement::_isInsideTolerance = 1.e-6;
MElement::MElement(int num, int part) : _visible(1)
{
#if defined(_OPENMP)
#pragma omp critical
#endif
{
// we should make GModel a mandatory argument to the constructor
GModel *m = GModel::current();
if(num){
_num = num;
m->setMaxElementNumber(std::max(m->getMaxElementNumber(), _num));
}
else{
m->setMaxElementNumber(m->getMaxElementNumber() + 1);
_num = m->getMaxElementNumber();
}
_partition = (short)part;
}
}
void MElement::setTolerance(const double tol)
{
_isInsideTolerance = tol;
}
double MElement::getTolerance()
{
return _isInsideTolerance;
}
void MElement::_getEdgeRep(MVertex *v0, MVertex *v1,
double *x, double *y, double *z, SVector3 *n,
int faceIndex)
{
x[0] = v0->x(); y[0] = v0->y(); z[0] = v0->z();
x[1] = v1->x(); y[1] = v1->y(); z[1] = v1->z();