Skip to content
Snippets Groups Projects
Select Git revision
  • 125a16a9d559a759df6a6b71cc9ef17a9b730e7b
  • master default
  • cgnsUnstructured
  • partitioning
  • poppler
  • HighOrderBLCurving
  • gmsh_3_0_4
  • gmsh_3_0_3
  • gmsh_3_0_2
  • gmsh_3_0_1
  • gmsh_3_0_0
  • gmsh_2_16_0
  • gmsh_2_15_0
  • gmsh_2_14_1
  • gmsh_2_14_0
  • gmsh_2_13_2
  • gmsh_2_13_1
  • gmsh_2_12_0
  • gmsh_2_11_0
  • gmsh_2_10_1
  • gmsh_2_10_0
  • gmsh_2_9_3
  • gmsh_2_9_2
  • gmsh_2_9_1
  • gmsh_2_9_0
  • gmsh_2_8_6
26 results

CreateFile.cpp

Blame
  • Forked from gmsh / gmsh
    Source project has a limited visibility.
    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();