gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
distanceTerm.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 #ifndef DISTANCE_TERM_H
7 #define DISTANCE_TERM_H
8 
9 #include "helmholtzTerm.h"
10 
11 class distanceTerm : public helmholtzTerm<double> {
12 public:
15  : helmholtzTerm<double>(gm, iField, iField, k, a)
16  {
17  }
19  {
20  MElement *e = se->getMeshElement();
21  int integrationOrder = 2 * e->getPolynomialOrder();
22  int npts;
23  IntPt *GP;
24  double jac[3][3];
25  double ff[256];
26  e->getIntegrationPoints(integrationOrder, &npts, &GP);
27  m.scale(0.);
28  for(int i = 0; i < npts; i++) {
29  const double u = GP[i].pt[0];
30  const double v = GP[i].pt[1];
31  const double w = GP[i].pt[2];
32  const double weight = GP[i].weight;
33  const double detJ = e->getJacobian(u, v, w, jac);
34  e->getShapeFunctions(u, v, w, ff);
35  for(std::size_t j = 0; j < e->getNumShapeFunctions(); j++) {
36  m(j) += ff[j] * weight * detJ;
37  }
38  }
39  }
40 };
41 
42 #endif
fullVector< double >
MElement::getIntegrationPoints
virtual void getIntegrationPoints(int pOrder, int *npts, IntPt **pts)
Definition: MElement.h:436
fullVector::scale
void scale(const scalar s)
Definition: fullMatrix.h:144
IntPt::pt
double pt[3]
Definition: GaussIntegration.h:13
helmholtzTerm.h
IntPt::weight
double weight
Definition: GaussIntegration.h:14
simpleFunction< double >
GModel
Definition: GModel.h:44
MElement::getNumShapeFunctions
virtual std::size_t getNumShapeFunctions() const
Definition: MElement.h:387
helmholtzTerm
Definition: helmholtzTerm.h:19
SElement
Definition: SElement.h:18
distanceTerm
Definition: distanceTerm.h:11
MElement
Definition: MElement.h:30
distanceTerm::elementVector
void elementVector(SElement *se, fullVector< double > &m) const
Definition: distanceTerm.h:18
SElement::getMeshElement
MElement * getMeshElement() const
Definition: SElement.h:35
IntPt
Definition: GaussIntegration.h:12
MElement::getShapeFunctions
virtual void getShapeFunctions(double u, double v, double w, double s[], int order=-1) const
Definition: MElement.cpp:458
MElement::getJacobian
virtual double getJacobian(const fullMatrix< double > &gsf, double jac[3][3]) const
Definition: MElement.cpp:868
MElement::getPolynomialOrder
virtual int getPolynomialOrder() const
Definition: MElement.h:78
distanceTerm::distanceTerm
distanceTerm(GModel *gm, int iField, simpleFunction< double > *k, simpleFunction< double > *a)
Definition: distanceTerm.h:13