gmsh-TingyuanDoc
0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
laplaceTerm.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 LAPLACE_TERM_H
7
#define LAPLACE_TERM_H
8
9
#include "
helmholtzTerm.h
"
10
11
// \nabla \cdot k \nabla U
12
class
laplaceTerm
:
public
helmholtzTerm
<double> {
13
protected
:
14
const
int
_iField
;
15
std::map<MVertex *, SPoint3> *
_coordView
;
16
17
public
:
18
laplaceTerm
(
GModel
*gm,
int
iField,
simpleFunction<double>
*k,
19
std::map<MVertex *, SPoint3> *coord =
nullptr
)
20
:
helmholtzTerm
<double>(gm, iField, iField, k, nullptr),
_iField
(iField),
21
_coordView
(coord)
22
{
23
}
24
void
elementVector
(
SElement
*se,
fullVector<double>
&m)
const
25
{
26
MElement
*e = se->
getMeshElement
();
27
int
nbSF = e->
getNumShapeFunctions
();
28
29
fullMatrix<double>
*mat;
30
mat =
new
fullMatrix<double>
(nbSF, nbSF);
31
elementMatrix
(se, *mat);
32
33
fullVector<double>
val(nbSF);
34
val.
scale
(0.);
35
for
(
int
i = 0; i < nbSF; i++) {
36
auto
it =
37
_coordView
->find(e->
getShapeFunctionNode
(i));
38
SPoint3
UV = it->second;
39
if
(
_iField
== 1)
40
val(i) = UV.
x
();
41
else
if
(
_iField
== 2)
42
val(i) = UV.
y
();
43
}
44
45
m.
scale
(0.);
46
for
(
int
i = 0; i < nbSF; i++)
47
for
(
int
j = 0; j < nbSF; j++) m(i) += -(*mat)(i, j) * val(j);
48
}
49
};
50
51
// a \nabla U
52
class
massTerm
:
public
helmholtzTerm
<double> {
53
public
:
54
massTerm
(
GModel
*gm,
int
iField,
simpleFunction<double>
*a)
55
:
helmholtzTerm
<double>(gm, iField, iField, nullptr, a)
56
{
57
}
58
};
59
60
#endif
laplaceTerm::_iField
const int _iField
Definition:
laplaceTerm.h:14
fullVector< double >
SPoint3
Definition:
SPoint3.h:14
laplaceTerm
Definition:
laplaceTerm.h:12
MElement::getShapeFunctionNode
virtual const MVertex * getShapeFunctionNode(int i) const
Definition:
MElement.h:392
fullVector::scale
void scale(const scalar s)
Definition:
fullMatrix.h:144
helmholtzTerm.h
laplaceTerm::_coordView
std::map< MVertex *, SPoint3 > * _coordView
Definition:
laplaceTerm.h:15
SPoint3::x
double x(void) const
Definition:
SPoint3.h:125
fullMatrix< double >
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
SPoint3::y
double y(void) const
Definition:
SPoint3.h:127
MElement
Definition:
MElement.h:30
massTerm::massTerm
massTerm(GModel *gm, int iField, simpleFunction< double > *a)
Definition:
laplaceTerm.h:54
laplaceTerm::laplaceTerm
laplaceTerm(GModel *gm, int iField, simpleFunction< double > *k, std::map< MVertex *, SPoint3 > *coord=nullptr)
Definition:
laplaceTerm.h:18
SElement::getMeshElement
MElement * getMeshElement() const
Definition:
SElement.h:35
massTerm
Definition:
laplaceTerm.h:52
laplaceTerm::elementVector
void elementVector(SElement *se, fullVector< double > &m) const
Definition:
laplaceTerm.h:24
helmholtzTerm< double >::elementMatrix
virtual void elementMatrix(SElement *se, fullMatrix< double > &m) const
Definition:
helmholtzTerm.h:50
src
solver
laplaceTerm.h
Generated by
1.8.18