FEMTIC
femtic
femtic_lib
include
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
27
#include "
Forward2DQuadrilateralElementEdgeBased.h
"
28
29
// Class of 2D forward calculation by using quadrilateral element 0th order edge based
30
class
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
:
public
Forward2DQuadrilateralElementEdgeBased
{
31
32
public
:
33
34
// Constructer
35
explicit
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
(
const
int
planeID,
const
int
iPol );
36
37
// Destructer
38
~Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
();
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
52
const
static
int
m_numIntegralPoints
=
m_numGauss
*
m_numGauss
;
53
54
double
m_integralPointXi
[
m_numIntegralPoints
];
55
56
double
m_integralPointEta
[
m_numIntegralPoints
];
57
58
double
m_weights
[
m_numIntegralPoints
];
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
73
bool
m_hasMadeMapSlaveDofToMasterDofAndFactors
;
74
75
// Array converting global node IDs after degeneration to the ones after constraint
76
int
*
m_IDsAfterDegenerated2AfterConstrained
;
77
78
// Total number of equations after degeneration and constraint
79
int
m_numEquationDegeneratedAndConstrained
;
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
86
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
();
87
88
// Copy constructer
89
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
(
const
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
& rhs);
90
91
// Copy assignment operator
92
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
&
operator=
(
const
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
& rhs);
93
94
// Calculate array converting local IDs to global ones
95
void
calcArrayConvertLocalID2Global
(
const
MeshDataNonConformingHexaElement
*
const
pMeshData );
96
97
// Make map converting master dofs after degeneration and MPC factors from slave dof after degeneration
98
void
makeMapSlaveDofToMasterDofAndFactors
(
const
MeshDataNonConformingHexaElement
*
const
pMeshData );
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
Forward2DQuadrilateralElementEdgeBased.h
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:30
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_etaAtEdge
double m_etaAtEdge[4]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:70
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::DIRICHLET_BOUNDARY_NONZERO_VALUE
static const int DIRICHLET_BOUNDARY_NONZERO_VALUE
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:45
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::getNeighborFaceIndexFromEdgeIndex
int getNeighborFaceIndexFromEdgeIndex(const int iEdge) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1036
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcArrayConvertLocalID2Global
void calcArrayConvertLocalID2Global(const MeshDataNonConformingHexaElement *const pMeshData)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:331
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcJacobianMatrix
double calcJacobianMatrix(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:857
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_numGauss
static const int m_numGauss
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:50
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::~Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
~Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased()
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:80
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcValueElectricFieldVertical
virtual std::complex< double > calcValueElectricFieldVertical(const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement *const pMeshDataElement) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:748
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_numIntegralPoints
static const int m_numIntegralPoints
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:52
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcInverseOfJacobianMatrix
void calcInverseOfJacobianMatrix(const Forward2D::Matrix2x2 &jacobMat, const double determinant, Forward2D::Matrix2x2 &invJacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:869
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::DIRICHLET_BOUNDARY_ZERO_VALUE
static const int DIRICHLET_BOUNDARY_ZERO_VALUE
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:46
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::isOuterEdge
bool isOuterEdge(const int iElem, const int iEdge, const MeshDataNonConformingHexaElement *const pMeshData) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1023
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_weights
double m_weights[m_numIntegralPoints]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:58
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::addMasterDofAndFactorPair
void addMasterDofAndFactorPair(const int slaveDof, const int masterDof, const double factor)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:881
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::getShapeFuncRotated
double getShapeFuncRotated(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:707
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::makeMapSlaveDofToMasterDofAndFactors
void makeMapSlaveDofToMasterDofAndFactors(const MeshDataNonConformingHexaElement *const pMeshData)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:482
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcJacobianMatrixOnZXPlaneOfBoundary
double calcJacobianMatrixOnZXPlaneOfBoundary(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:795
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcValueMagneticFieldPerpendicular
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
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_integralPointEta
double m_integralPointEta[m_numIntegralPoints]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:56
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::setNonZeroValues
void setNonZeroValues(const double freq, const MeshDataNonConformingHexaElement *const pMeshData)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:939
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_xiAtEdge
double m_xiAtEdge[4]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:67
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::setNonZeroStrucuture
void setNonZeroStrucuture(const MeshDataNonConformingHexaElement *const pMeshData)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:899
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::operator=
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased & operator=(const Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased &rhs)
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_numEquationDegeneratedAndConstrained
int m_numEquationDegeneratedAndConstrained
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:79
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcJacobianMatrixOnYZPlaneOfBoundary
double calcJacobianMatrixOnYZPlaneOfBoundary(const MeshDataNonConformingHexaElement *const pMeshData, const int elemID2D, const double xi, const double eta, Forward2D::Matrix2x2 &jacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:826
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased()
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_IDsAfterDegenerated2AfterConstrained
int * m_IDsAfterDegenerated2AfterConstrained
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:76
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::getShapeFuncV
double getShapeFuncV(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:687
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased(const Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased &rhs)
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_integralPointXi
double m_integralPointXi[m_numIntegralPoints]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:54
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcEMFieldsOfBoundaryPlanes
virtual void calcEMFieldsOfBoundaryPlanes(const double freq, const MeshDataNonConformingHexaElement *const pMeshData)
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:84
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::calcValueElectricFieldHorizontal
virtual std::complex< double > calcValueElectricFieldHorizontal(const int iElem, const double xi, const double eta, const MeshDataNonConformingHexaElement *const pMeshDataElement) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:727
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::SLAVE_DOFS
static const int SLAVE_DOFS
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:48
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_hasMadeMapSlaveDofToMasterDofAndFactors
bool m_hasMadeMapSlaveDofToMasterDofAndFactors
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:73
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_etaAtNode
double m_etaAtNode[4]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:64
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::getShapeFuncH
double getShapeFuncH(const double xi, const double eta, const int num, const Forward2D::Matrix2x2 &invJacobMat) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:667
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::faceSlaveElements
bool faceSlaveElements(const int iElem, const int iEdge, const MeshDataNonConformingHexaElement *const pMeshData) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:1010
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_xiAtNode
double m_xiAtNode[4]
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:61
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::getTypeOfOuterEdgeOfBoundaryPlanes
int getTypeOfOuterEdgeOfBoundaryPlanes(const int edgeIDLocal2D) const
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.cpp:636
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased::m_slaveDofToMasterDofAndFactors
std::vector< std::pair< int, double > > * m_slaveDofToMasterDofAndFactors
Definition:
Forward2DNonConformingQuadrilateralElement0thOrderEdgeBased.h:83
Forward2DQuadrilateralElementEdgeBased
Definition:
Forward2DQuadrilateralElementEdgeBased.h:30
MeshDataNonConformingHexaElement
Definition:
MeshDataNonConformingHexaElement.h:31
Forward2D::Matrix2x2
Definition:
Forward2D.h:58
Generated by
1.9.1