gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
quadratureRules.h
Go to the documentation of this file.
1 // Gmsh - Copyright (C) 1997-2022 C. Geuzaine, J.-F. Remacle
2 //
3 // See the LICENSE.txt file in the Gmsh root directory for license information.
4 // Please report all issues on https://gitlab.onelab.info/gmsh/gmsh/issues.
5 //
6 // Contributor(s):
7 // Eric Bechet
8 //
9 
10 #ifndef QUADRATURERULES_H
11 #define QUADRATURERULES_H
12 
13 #include "GaussIntegration.h"
14 #include "MElement.h"
15 
17 public:
18  virtual ~QuadratureBase() {}
19  virtual int getIntPoints(MElement *e, IntPt **GP) = 0;
20 };
21 
22 // For rigid contact no need of Gauss'integration
23 // but to use clasical get function in term npts and IntPt are needed
24 // so use a empty gaussQuadrature rule
26 public:
29  int getIntPoints(MElement *e, IntPt **GP)
30  {
31  GP = nullptr;
32  return 0;
33  }
34 };
35 
37 public:
39 
40 private:
41  int order;
43 
44 public:
45  GaussQuadrature(int order_ = 0) : order(order_), info(Other) {}
46  GaussQuadrature(IntegCases info_) : order(0), info(info_) {}
47  virtual ~GaussQuadrature() {}
48  virtual int getIntPoints(MElement *e, IntPt **GP)
49  {
50  int integrationOrder;
51  int npts;
52  int geoorder = e->getPolynomialOrder();
53  switch(info) {
54  case Other: integrationOrder = order; break;
55  case Val: integrationOrder = geoorder + 1; break;
56  case Grad: integrationOrder = geoorder; break;
57  case ValVal: integrationOrder = 2 * geoorder; break;
58  case GradGrad: integrationOrder = 3 * (geoorder - 1) + 1; break;
59  default: integrationOrder = 1;
60  }
61  e->getIntegrationPoints(integrationOrder, &npts, GP);
62  return npts;
63  }
64  // copy constructor
66  : order(other.order), info(other.info)
67  {
68  }
69 };
70 
71 #endif //_QUADRATURERULES_H_
GaussQuadrature::info
IntegCases info
Definition: quadratureRules.h:42
GaussQuadrature::Other
@ Other
Definition: quadratureRules.h:38
GaussQuadrature::ValVal
@ ValVal
Definition: quadratureRules.h:38
QuadratureVoid::getIntPoints
int getIntPoints(MElement *e, IntPt **GP)
Definition: quadratureRules.h:29
QuadratureBase
Definition: quadratureRules.h:16
MElement::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MElement.h:436
GaussQuadrature::~GaussQuadrature
virtual ~GaussQuadrature()
Definition: quadratureRules.h:47
GaussIntegration.h
QuadratureVoid
Definition: quadratureRules.h:25
QuadratureBase::~QuadratureBase
virtual ~QuadratureBase()
Definition: quadratureRules.h:18
QuadratureVoid::QuadratureVoid
QuadratureVoid()
Definition: quadratureRules.h:27
GaussQuadrature::Grad
@ Grad
Definition: quadratureRules.h:38
QuadratureBase::getIntPoints
virtual int getIntPoints(MElement *e, IntPt **GP)=0
GaussQuadrature::order
int order
Definition: quadratureRules.h:41
GaussQuadrature::IntegCases
IntegCases
Definition: quadratureRules.h:38
GaussQuadrature::GaussQuadrature
GaussQuadrature(IntegCases info_)
Definition: quadratureRules.h:46
GaussQuadrature::GaussQuadrature
GaussQuadrature(int order_=0)
Definition: quadratureRules.h:45
QuadratureVoid::~QuadratureVoid
~QuadratureVoid()
Definition: quadratureRules.h:28
GaussQuadrature::GradGrad
@ GradGrad
Definition: quadratureRules.h:38
MElement
Definition: MElement.h:30
IntPt
Definition: GaussIntegration.h:12
GaussQuadrature::GaussQuadrature
GaussQuadrature(const GaussQuadrature &other)
Definition: quadratureRules.h:65
MElement.h
GaussQuadrature::Val
@ Val
Definition: quadratureRules.h:38
MElement::getPolynomialOrder
virtual int getPolynomialOrder() const
Definition: MElement.h:78
GaussQuadrature::getIntPoints
virtual int getIntPoints(MElement *e, IntPt **GP)
Definition: quadratureRules.h:48
GaussQuadrature
Definition: quadratureRules.h:36