FEMTIC
Forward2DTriangleElement.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_TRIANGLE_ELEMENT
25 #define DBLDEF_FORWARD_2D_TRIANGLE_ELEMENT
26 
27 #include "Forward2D.h"
28 #include "MeshDataTetraElement.h"
29 #include <utility>
30 #include <map>
31 
32 // Class of 2D forward calculation by using triangle element
34 
35 public:
36 
37  // Constructer
38  explicit Forward2DTriangleElement( const int planeID, const int iPol );
39 
40  // Destructer
42 
43  // Calculate EM fields of boundary planes by 2D forward calculcation with 1st order nodal element
44  virtual void calcEMFieldsOfBoundaryPlanes( const double freq, const MeshDataTetraElement* const pMeshDataTetraElement ) = 0;
45 
47  //int countTotalNodeNumberOnPlane( const MeshDataTetraElement* const pMeshDataTetraElement );
48 
50  //int countOuterEdgesOnPlane( const MeshDataTetraElement* const pMeshDataTetraElement ) const;
51 
52 protected:
53 
54  //std::vector< std::pair< std::pair<int, int>, int> > m_globalEdgeID2GlobalNodePairAndElemID;
55 
56  //struct NodeIDsOfTriangleElement{
57  // int node0;
58  // int node1;
59  // int node2;
60  //};
61 
62  // Total node number of equation
64 
65  // Total node number of equation after degenerated
67 
68  // Total node number of 2D mesh
70 
71  // Array converting global node IDs of 3D mesh to the ones of 2D mesh
72  std::map<int,int> m_nodeIDs3DTo2D;
73 
75  //void calcArrayConvertingNodeIDs3DTo2D( const MeshDataTetraElement* const pMeshDataTetraElement );
76 
77  // Output EM field and responses of boundary planes obtained by 2D analysis
78  void output2DResult( const double freq, const MeshDataTetraElement* const pMeshDataTetraElement ) const;
79 
80 private:
81 
82  // Defailt constructer
84 
85  // Copy constructer
87 
88  // Copy assignment operator
90 
92  //void numberGlobalEdgesIDs( const MeshDataTetraElement* const pMeshDataTetraElement ) const;
93 
94  // Calculate Ex
95  virtual std::complex<double> calcEx( const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
96 
97  // Calculate Ey
98  virtual std::complex<double> calcEy( const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
99 
100  // Calculate Ez
101  virtual std::complex<double> calcEz( const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
102 
103  // Calculate Hx
104  virtual std::complex<double> calcHx( const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
105 
106  // Calculate Hy
107  virtual std::complex<double> calcHy( const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
108 
109  // Calculate Hz
110  virtual std::complex<double> calcHz( const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement* const pMeshDataTetraElement ) const = 0;
111 
112 };
113 
114 #endif
Definition: Forward2DTriangleElement.h:33
virtual std::complex< double > calcHy(const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
~Forward2DTriangleElement()
Definition: Forward2DTriangleElement.cpp:44
Forward2DTriangleElement(const Forward2DTriangleElement &rhs)
virtual std::complex< double > calcEz(const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
virtual std::complex< double > calcEy(const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
virtual std::complex< double > calcHz(const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
int m_numEquations
Definition: Forward2DTriangleElement.h:63
virtual void calcEMFieldsOfBoundaryPlanes(const double freq, const MeshDataTetraElement *const pMeshDataTetraElement)=0
std::map< int, int > m_nodeIDs3DTo2D
Definition: Forward2DTriangleElement.h:72
void output2DResult(const double freq, const MeshDataTetraElement *const pMeshDataTetraElement) const
Definition: Forward2DTriangleElement.cpp:245
int m_numNodeTotal2D
Definition: Forward2DTriangleElement.h:69
Forward2DTriangleElement & operator=(const Forward2DTriangleElement &rhs)
int m_numEquationsDegenerated
Definition: Forward2DTriangleElement.h:66
virtual std::complex< double > calcEx(const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
virtual std::complex< double > calcHx(const double freq, const int iElem, const double uCoord, const double vCoord, const MeshDataTetraElement *const pMeshDataTetraElement) const =0
Definition: Forward2D.h:31
Definition: MeshDataTetraElement.h:32