OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
CurlCoefficients.h
Go to the documentation of this file.
1#pragma once
6
7template <class T>
9{
10protected:
14 float _stabilityFactor = 0.98f;
15
16 double(MaterialProperties::*GetMaterialInXAtIndex)(index_t index) const = nullptr;
17 double(MaterialProperties::*GetMaterialInYAtIndex)(index_t index) const = nullptr;
18 double(MaterialProperties::*GetMaterialInZAtIndex)(index_t index) const = nullptr;
19
20 inline bool HasZeroValueAtIndex(index_t index);
21 inline float Potenz(float base, float exp) { return powf(base, exp); }
22 inline double Potenz(double base, double exp) { return pow(base, exp); }
23 inline double SqrRoot(double value) { return sqrt(value); }
24 inline float SqrRoot(float value) { return sqrtf(value); }
25
26 virtual void CheckConsistency() = 0;
27 virtual void CalculateTimeStep() = 0;
28 virtual void CreateCoefficients() = 0;
29 virtual void InitiateCoefficientContainer() = 0;
30
31public:
32 void SummarizeDescretizationAsCoefficients(SurfaceDiscretization & surfaceDisc, EdgeDiscretization & edgeDisc, MaterialProperties & materialProp, double(MaterialProperties::*GetActiveMaterialInXAtIndex)(index_t index) const, double(MaterialProperties::*GetActiveMaterialInYAtIndex)(index_t index) const, double(MaterialProperties::*GetActiveMaterialInZAtIndex)(index_t index) const)
33 {
34 GetMaterialInXAtIndex = GetActiveMaterialInXAtIndex;
35 GetMaterialInYAtIndex = GetActiveMaterialInYAtIndex;
36 GetMaterialInZAtIndex = GetActiveMaterialInZAtIndex;
37
38 _surfaceDiscretization = &surfaceDisc;
39 _edgeDiscretization = &edgeDisc;
40 _materialProperties = &materialProp;
41
46
47 GetMaterialInXAtIndex = nullptr;
48 GetMaterialInYAtIndex = nullptr;
49 GetMaterialInZAtIndex = nullptr;
50 _surfaceDiscretization = nullptr;
51 _edgeDiscretization = nullptr;
52 _materialProperties = nullptr;
53 };
54
55};
56
57template<class T>
59{
60 return (
61 _materialProperties->GetPermeabilityInX(index) == 0 || _materialProperties->GetPermittivityInX(index) == 0 ||
62 _materialProperties->GetPermeabilityInY(index) == 0 || _materialProperties->GetPermittivityInY(index) == 0 ||
63 _materialProperties->GetPermeabilityInZ(index) == 0 || _materialProperties->GetPermittivityInZ(index) == 0 ||
64 _edgeDiscretization->GetDeltaXAtIndex(index) == 0 || _edgeDiscretization->GetDeltaYAtIndex(index) == 0 ||
65 _edgeDiscretization->GetDeltaZAtIndex(index) == 0
66 );
67}
bsoncxx::types::value value
Definition DocumentManager.h:16
int64_t index_t
Definition SystemDependentDefines.h:13
Definition CurlCoefficients.h:9
MaterialProperties * _materialProperties
Definition CurlCoefficients.h:13
float _stabilityFactor
Definition CurlCoefficients.h:14
void SummarizeDescretizationAsCoefficients(SurfaceDiscretization &surfaceDisc, EdgeDiscretization &edgeDisc, MaterialProperties &materialProp, double(MaterialProperties::*GetActiveMaterialInXAtIndex)(index_t index) const, double(MaterialProperties::*GetActiveMaterialInYAtIndex)(index_t index) const, double(MaterialProperties::*GetActiveMaterialInZAtIndex)(index_t index) const)
Definition CurlCoefficients.h:32
SurfaceDiscretization * _surfaceDiscretization
Definition CurlCoefficients.h:11
virtual void CheckConsistency()=0
float SqrRoot(float value)
Definition CurlCoefficients.h:24
virtual void CreateCoefficients()=0
EdgeDiscretization * _edgeDiscretization
Definition CurlCoefficients.h:12
double SqrRoot(double value)
Definition CurlCoefficients.h:23
double(MaterialProperties::* GetMaterialInXAtIndex)(index_t index) const
Definition CurlCoefficients.h:16
double Potenz(double base, double exp)
Definition CurlCoefficients.h:22
virtual void CalculateTimeStep()=0
virtual void InitiateCoefficientContainer()=0
Definition EdgeDiscretization.h:8
const double GetDeltaZAtIndex(index_t index) const
Definition EdgeDiscretization.h:57
const double GetDeltaXAtIndex(index_t index) const
Definition EdgeDiscretization.h:33
const double GetDeltaYAtIndex(index_t index) const
Definition EdgeDiscretization.h:45
Definition MaterialProperties.h:5
double GetPermittivityInX(index_t index) const
Definition MaterialProperties.h:57
double GetPermeabilityInX(index_t index) const
Definition MaterialProperties.h:44
double GetPermittivityInY(index_t index) const
Definition MaterialProperties.h:61
double GetPermeabilityInZ(index_t index) const
Definition MaterialProperties.h:52
double GetPermittivityInZ(index_t index) const
Definition MaterialProperties.h:65
double GetPermeabilityInY(index_t index) const
Definition MaterialProperties.h:48
Definition SurfaceDiscretization.h:10