FEMTIC
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h
Go to the documentation of this file.
1 //-------------------------------------------------------------------------------------------------------
2 // The MIT License (MIT)
3 //
4 // Copyright (c) 2021 Yoshiya Usui
5 //
6 // Permission is hereby granted, free of charge, to any person obtaining a copy
7 // of this software and associated documentation files (the "Software"), to deal
8 // in the Software without restriction, including without limitation the rights
9 // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 // copies of the Software, and to permit persons to whom the Software is
11 // furnished to do so, subject to the following conditions:
12 //
13 // The above copyright notice and this permission notice shall be included in all
14 // copies or substantial portions of the Software.
15 //
16 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22 // SOFTWARE.
23 //-------------------------------------------------------------------------------------------------------
24 #ifndef DBLDEF_FORWARD_2D_NONCONFORMING_QUAD_ELEMENT_0TH_ORDER_EDGE_BASED
25 #define DBLDEF_FORWARD_2D_NONCONFORMING_QUAD_ELEMENT_0TH_ORDER_EDGE_BASED
26 
28 
29 // Class of 2D forward calculation by using quadrilateral element 0th order edge based
31 
32 public:
33 
34  // Constructer
35  explicit Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased( const int planeID, const int iPol );
36 
37  // Destructer
39 
40  // Calculate EM fields of boundary planes by 2D forward calculcation with 0tht order edge element
41  virtual void calcEMFieldsOfBoundaryPlanes( const double freq, const MeshDataNonConformingHexaElement* const pMeshData );
42 
43 private:
44 
45  static const int DIRICHLET_BOUNDARY_NONZERO_VALUE = -1;
46  static const int DIRICHLET_BOUNDARY_ZERO_VALUE = -2;
47 
48  const static int SLAVE_DOFS = -3;
49 
50  const static int m_numGauss = 2;
51 
53 
55 
57 
59 
60  // Array of reference coord xi values for each node
61  double m_xiAtNode[4];
62 
63  // Array of reference coord eta values for each node
64  double m_etaAtNode[4];
65 
66  // Array of reference coord xi values for each edge
67  double m_xiAtEdge[4];
68 
69  // Array of reference coord eta values for each edge
70  double m_etaAtEdge[4];
71 
72  // Flag specifing wether map converting master dofs after degeneration and MPC factors from slave dof after degeneration has been made
74 
75  // Array converting global node IDs after degeneration to the ones after constraint
77 
78  // Total number of equations after degeneration and constraint
80 
81  // Map converting master dofs after degeneration and MPC factors from slave dof after degeneration
82  // Even for master dofs, master dof and factors are inserted (in this case, master dof is equal to index and factor is one)
83  std::vector< std::pair<int,double> >* m_slaveDofToMasterDofAndFactors;
84 
85  // Defailt constructer
87 
88  // Copy constructer
90 
91  // Copy assignment operator
93 
94  // Calculate array converting local IDs to global ones
96 
97  // Make map converting master dofs after degeneration and MPC factors from slave dof after degeneration
99 
100  // Get type of outer edge
101  // [note] : You must confirm inputed edge is the outer edge.
102  int getTypeOfOuterEdgeOfBoundaryPlanes( const int edgeIDLocal2D ) const;
103 
104  // Get shape functions of the horizontal direction with respect to the reference element coordinate system
105  double getShapeFuncH( const double xi, const double eta, const int num, const Forward2D::Matrix2x2& invJacobMat ) const;
106 
107  // Get shape functions of the vertical direction with respect to the reference element coordinate system
108  double getShapeFuncV( const double xi, const double eta, const int num, const Forward2D::Matrix2x2& invJacobMat) const;
109 
110  // Get shape functions rotated with respect to the reference element coordinate system
111  double getShapeFuncRotated( const double xi, const double eta, const int num, const Forward2D::Matrix2x2& invJacobMat ) const;
112 
113  // Calculate horizontal electric field
114  virtual std::complex<double> calcValueElectricFieldHorizontal( const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement* const pMeshDataElement ) const;
115 
116  // Calculate vertical electric field
117  virtual std::complex<double> calcValueElectricFieldVertical( const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement* const pMeshDataElement ) const;
118 
119  // Calculate magnetic field perpendicular to the boundary plane
120  virtual std::complex<double> calcValueMagneticFieldPerpendicular( const double freq, const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement* const pMeshDataElement ) const;
121 
122  // Calculate jacobian matrix of the elements on the Z-X plane of boundary
123  double calcJacobianMatrixOnZXPlaneOfBoundary( const MeshDataNonConformingHexaElement* const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2& jacobMat ) const;
124 
125  // Calculate jacobian matrix of the elements on the Y-Z plane of boundary
126  double calcJacobianMatrixOnYZPlaneOfBoundary( const MeshDataNonConformingHexaElement* const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2& jacobMat ) const;
127 
128  // Calculate jacobian matrix
129  double calcJacobianMatrix( const MeshDataNonConformingHexaElement* const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2& jacobMat ) const;
130 
131  // Calculate inverse of jacobian matrix multiplied by determinant
132  void calcInverseOfJacobianMatrix( const Forward2D::Matrix2x2& jacobMat, const double determinant, Forward2D::Matrix2x2& invJacobMat ) const;
133 
134  // Add master dof and factor pair to m_slaveDofToMasterDofAndFactors
135  void addMasterDofAndFactorPair( const int slaveDof, const int masterDof, const double factor );
136 
137  // Set non-zero strucuture of matrix for forward calculation
138  void setNonZeroStrucuture( const MeshDataNonConformingHexaElement* const pMeshData );
139 
140  // Set non-zero values of matrix and right-hande side vector for forward calculation
141  void setNonZeroValues( const double freq, const MeshDataNonConformingHexaElement* const pMeshData );
142 
143  // Get flag specifing whether an 2-D element faces slave element
144  bool faceSlaveElements( const int iElem, const int iEdge, const MeshDataNonConformingHexaElement* const pMeshData ) const;
145 
146  // Get flag specifing whether the inputted element edge is an outer edge
147  bool isOuterEdge( const int iElem, const int iEdge, const MeshDataNonConformingHexaElement* const pMeshData ) const;
148 
149  // Get neighbor face index from edge index
150  int getNeighborFaceIndexFromEdgeIndex( const int iEdge ) const;
151 
152 };
153 
154 #endif
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:30
double m_etaAtEdge[4]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:70
static const int DIRICHLET_BOUNDARY_NONZERO_VALUE
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:45
int getNeighborFaceIndexFromEdgeIndex(const int iEdge) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1036
void calcArrayConvertLocalID2Global(const MeshDataNonConformingHexaElement *const pMeshData)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:331
double calcJacobianMatrix(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:857
static const int m_numGauss
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:50
~Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased()
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:80
virtual std::complex< double > calcValueElectricFieldVertical(const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement *const pMeshDataElement) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:748
static const int m_numIntegralPoints
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:52
void calcInverseOfJacobianMatrix(const Forward2D::Matrix2x2 &jacobMat, const double determinant, Forward2D::Matrix2x2 &invJacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:869
static const int DIRICHLET_BOUNDARY_ZERO_VALUE
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:46
bool isOuterEdge(const int iElem, const int iEdge, const MeshDataNonConformingHexaElement *const pMeshData) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1023
double m_weights[m_numIntegralPoints]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:58
void addMasterDofAndFactorPair(const int slaveDof, const int masterDof, const double factor)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:881
double getShapeFuncRotated(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:707
void makeMapSlaveDofToMasterDofAndFactors(const MeshDataNonConformingHexaElement *const pMeshData)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:482
double calcJacobianMatrixOnZXPlaneOfBoundary(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:795
virtual std::complex< double > calcValueMagneticFieldPerpendicular(const double freq, const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement *const pMeshDataElement) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:769
double m_integralPointEta[m_numIntegralPoints]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:56
void setNonZeroValues(const double freq, const MeshDataNonConformingHexaElement *const pMeshData)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:939
double m_xiAtEdge[4]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:67
void setNonZeroStrucuture(const MeshDataNonConformingHexaElement *const pMeshData)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:899
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased & operator=(const Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased &rhs)
int m_numEquationDegeneratedAndConstrained
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:79
double calcJacobianMatrixOnYZPlaneOfBoundary(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:826
int * m_IDsAfterDegenerated2AfterConstrained
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:76
double getShapeFuncV(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:687
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased(const Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased &rhs)
double m_integralPointXi[m_numIntegralPoints]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:54
virtual void calcEMFieldsOfBoundaryPlanes(const double freq, const MeshDataNonConformingHexaElement *const pMeshData)
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:84
virtual std::complex< double > calcValueElectricFieldHorizontal(const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement *const pMeshDataElement) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:727
static const int SLAVE_DOFS
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:48
bool m_hasMadeMapSlaveDofToMasterDofAndFactors
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:73
double m_etaAtNode[4]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:64
double getShapeFuncH(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:667
bool faceSlaveElements(const int iElem, const int iEdge, const MeshDataNonConformingHexaElement *const pMeshData) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1010
double m_xiAtNode[4]
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:61
int getTypeOfOuterEdgeOfBoundaryPlanes(const int edgeIDLocal2D) const
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:636
std::vector< std::pair< int, double > > * m_slaveDofToMasterDofAndFactors
Definition: Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:83
Definition: Forward2DQuadrilateralElementEdgeBased.h:30
Definition: MeshDataNonConformingHexaElement.h:31
Definition: Forward2D.h:58