gmsh-TingyuanDoc  0.1
An Open-Source Timing-driven Analytical Mixed-size FPGA Placer
CondNumBasis.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 CONDNUMBASIS_H
7 #define CONDNUMBASIS_H
8 
9 #include <map>
10 #include <vector>
11 #include "JacobianBasis.h"
12 #include "fullMatrix.h"
13 
14 class CondNumBasis {
15 private:
17 
18  const int _tag, _dim, _condNumOrder;
19 
21 
24 
25 public:
26  CondNumBasis(int tag, int cnOrder = -1);
27 
28  // Get methods
29  inline int getCondNumOrder() const { return _condNumOrder; }
30  inline int getNumCondNumNodes() const { return _nCondNumNodes; }
31  inline int getNumMapNodes() const { return _nMapNodes; }
32  inline int getNumPrimMapNodes() const { return _nPrimMapNodes; }
33 
34  // Order calculation
35  static int condNumOrder(int tag);
36  static int condNumOrder(int parentType, int order);
37 
38  // Condition number evaluation methods
39  inline void getInvCondNum(const fullMatrix<double> &nodesXYZ,
40  fullVector<double> &invCond) const
41  {
44  _gradBasis->dShapeIdealMat_dZ, nodesXYZ, invCond);
45  }
46  inline void getSignedInvCondNum(const fullMatrix<double> &nodesXYZ,
47  const fullMatrix<double> &normals,
48  fullVector<double> &invCond) const
49  {
52  _gradBasis->dShapeIdealMat_dZ, nodesXYZ, normals,
53  invCond);
54  }
55  inline void getInvCondNumAndGradients(const fullMatrix<double> &nodesXYZ,
56  fullMatrix<double> &IDI) const
57  {
61  IDI);
62  }
63  inline void
65  const fullMatrix<double> &normals,
66  fullMatrix<double> &IDI) const
67  {
71  normals, IDI);
72  }
73 
74 private:
75  template <bool sign>
76  void getInvCondNumGeneral(int nCondNumNodes,
77  const fullMatrix<double> &dSMat_dX,
78  const fullMatrix<double> &dSMat_dY,
79  const fullMatrix<double> &dSMat_dZ,
80  const fullMatrix<double> &nodesXYZ,
81  const fullMatrix<double> &normals,
82  fullVector<double> &invCond) const;
83  void getInvCondNumGeneral(int nCondNumNodes,
84  const fullMatrix<double> &dSMat_dX,
85  const fullMatrix<double> &dSMat_dY,
86  const fullMatrix<double> &dSMat_dZ,
87  const fullMatrix<double> &nodesXYZ,
88  fullVector<double> &invCond) const;
89  void getSignedInvCondNumGeneral(int nCondNumNodes,
90  const fullMatrix<double> &dSMat_dX,
91  const fullMatrix<double> &dSMat_dY,
92  const fullMatrix<double> &dSMat_dZ,
93  const fullMatrix<double> &nodesXYZ,
94  const fullMatrix<double> &normals,
95  fullVector<double> &invCond) const;
96 
97  template <bool sign>
98  void getInvCondNumAndGradientsGeneral(int nCondNumNodes,
99  const fullMatrix<double> &dSMat_dX,
100  const fullMatrix<double> &dSMat_dY,
101  const fullMatrix<double> &dSMat_dZ,
102  const fullMatrix<double> &nodesXYZ,
103  const fullMatrix<double> &normals,
104  fullMatrix<double> &IDI) const;
106  int nCondNumNodes, // No normal given -> unsigned measure
107  const fullMatrix<double> &dSMat_dX, const fullMatrix<double> &dSMat_dY,
108  const fullMatrix<double> &dSMat_dZ, const fullMatrix<double> &nodesXYZ,
109  fullMatrix<double> &IDI) const;
111  int nCondNumNodes, // Normals given -> signed measure
112  const fullMatrix<double> &dSMat_dX, const fullMatrix<double> &dSMat_dY,
113  const fullMatrix<double> &dSMat_dZ, const fullMatrix<double> &nodesXYZ,
114  const fullMatrix<double> &normals, fullMatrix<double> &IDI) const;
115 };
116 
117 #endif
CondNumBasis::getInvCondNumGeneral
void getInvCondNumGeneral(int nCondNumNodes, const fullMatrix< double > &dSMat_dX, const fullMatrix< double > &dSMat_dY, const fullMatrix< double > &dSMat_dZ, const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullVector< double > &invCond) const
Definition: CondNumBasis.cpp:428
fullVector< double >
CondNumBasis::getCondNumOrder
int getCondNumOrder() const
Definition: CondNumBasis.h:29
CondNumBasis::_condNumOrder
const int _condNumOrder
Definition: CondNumBasis.h:18
CondNumBasis::getSignedInvCondNum
void getSignedInvCondNum(const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullVector< double > &invCond) const
Definition: CondNumBasis.h:46
CondNumBasis::getNumPrimMapNodes
int getNumPrimMapNodes() const
Definition: CondNumBasis.h:32
CondNumBasis
Definition: CondNumBasis.h:14
CondNumBasis::condNumOrder
static int condNumOrder(int tag)
Definition: CondNumBasis.cpp:399
CondNumBasis::_gradBasis
const GradientBasis * _gradBasis
Definition: CondNumBasis.h:16
CondNumBasis::_nMapNodes
int _nMapNodes
Definition: CondNumBasis.h:23
fullMatrix< double >
CondNumBasis::getSignedInvCondNumAndGradientsGeneral
void getSignedInvCondNumAndGradientsGeneral(int nCondNumNodes, const fullMatrix< double > &dSMat_dX, const fullMatrix< double > &dSMat_dY, const fullMatrix< double > &dSMat_dZ, const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullMatrix< double > &IDI) const
Definition: CondNumBasis.cpp:602
CondNumBasis::getSignedInvCondNumGeneral
void getSignedInvCondNumGeneral(int nCondNumNodes, const fullMatrix< double > &dSMat_dX, const fullMatrix< double > &dSMat_dY, const fullMatrix< double > &dSMat_dZ, const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullVector< double > &invCond) const
Definition: CondNumBasis.cpp:500
CondNumBasis::getSignedInvCondNumAndGradients
void getSignedInvCondNumAndGradients(const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullMatrix< double > &IDI) const
Definition: CondNumBasis.h:64
CondNumBasis::_nCondNumNodes
int _nCondNumNodes
Definition: CondNumBasis.h:22
CondNumBasis::dPrimBaryShape_dZ
fullVector< double > dPrimBaryShape_dZ
Definition: CondNumBasis.h:20
CondNumBasis::dPrimBaryShape_dX
fullVector< double > dPrimBaryShape_dX
Definition: CondNumBasis.h:20
JacobianBasis.h
CondNumBasis::_nPrimMapNodes
int _nPrimMapNodes
Definition: CondNumBasis.h:23
GradientBasis::dShapeIdealMat_dZ
fullMatrix< double > dShapeIdealMat_dZ
Definition: JacobianBasis.h:15
CondNumBasis::_dim
const int _dim
Definition: CondNumBasis.h:18
CondNumBasis::dPrimBaryShape_dY
fullVector< double > dPrimBaryShape_dY
Definition: CondNumBasis.h:20
CondNumBasis::getInvCondNumAndGradientsGeneral
void getInvCondNumAndGradientsGeneral(int nCondNumNodes, const fullMatrix< double > &dSMat_dX, const fullMatrix< double > &dSMat_dY, const fullMatrix< double > &dSMat_dZ, const fullMatrix< double > &nodesXYZ, const fullMatrix< double > &normals, fullMatrix< double > &IDI) const
Definition: CondNumBasis.cpp:515
GradientBasis::dShapeIdealMat_dY
fullMatrix< double > dShapeIdealMat_dY
Definition: JacobianBasis.h:15
GradientBasis::dShapeIdealMat_dX
fullMatrix< double > dShapeIdealMat_dX
Definition: JacobianBasis.h:15
CondNumBasis::_tag
const int _tag
Definition: CondNumBasis.h:18
CondNumBasis::CondNumBasis
CondNumBasis(int tag, int cnOrder=-1)
Definition: CondNumBasis.cpp:341
CondNumBasis::getInvCondNum
void getInvCondNum(const fullMatrix< double > &nodesXYZ, fullVector< double > &invCond) const
Definition: CondNumBasis.h:39
CondNumBasis::getInvCondNumAndGradients
void getInvCondNumAndGradients(const fullMatrix< double > &nodesXYZ, fullMatrix< double > &IDI) const
Definition: CondNumBasis.h:55
CondNumBasis::getNumCondNumNodes
int getNumCondNumNodes() const
Definition: CondNumBasis.h:30
GradientBasis
Definition: JacobianBasis.h:12
fullMatrix.h
CondNumBasis::getNumMapNodes
int getNumMapNodes() const
Definition: CondNumBasis.h:31