OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
EdgeDiscretization.h
Go to the documentation of this file.
1#pragma once
4
5#include <stdexcept>
6
8{
9
10private:
11 const double* deltaX = nullptr;
12 const double* deltaY = nullptr;
13 const double* deltaZ = nullptr;
14
15public:
16 explicit EdgeDiscretization(){};
18 {
19 deltaX = nullptr;
20 deltaY = nullptr;
21 deltaZ = nullptr;
22 };
25
26 void ExtractComponentsFromSingleVector(const std::vector<double> & surfaceDiscretizations) override;
27
28 inline const double GetDeltaXAtIndex(index_t index) const;
29 inline const double GetDeltaYAtIndex(index_t index) const;
30 inline const double GetDeltaZAtIndex(index_t index) const;
31};
32
33inline const double EdgeDiscretization::GetDeltaXAtIndex(index_t index) const
34{
35 if (index < numberOfNodes)
36 {
37 return deltaX[index];
38 }
39 else
40 {
41 throw std::out_of_range(outOfRangeMessage);
42 }
43}
44
45inline const double EdgeDiscretization::GetDeltaYAtIndex(index_t index) const
46{
47 if (index < numberOfNodes)
48 {
49 return deltaY[index];
50 }
51 else
52 {
53 throw std::out_of_range(outOfRangeMessage);
54 }
55}
56
57inline const double EdgeDiscretization::GetDeltaZAtIndex(index_t index) const
58{
59 if (index < numberOfNodes)
60 {
61 return deltaZ[index];
62 }
63 else
64 {
65 throw std::out_of_range(outOfRangeMessage);
66 }
67}
int64_t index_t
Definition SystemDependentDefines.h:13
Definition EdgeDiscretization.h:8
EdgeDiscretization & operator=(const EdgeDiscretization &other)=delete
const double GetDeltaZAtIndex(index_t index) const
Definition EdgeDiscretization.h:57
EdgeDiscretization(EdgeDiscretization &other)=delete
~EdgeDiscretization()
Definition EdgeDiscretization.h:17
void ExtractComponentsFromSingleVector(const std::vector< double > &surfaceDiscretizations) override
Definition EdgeDiscretization.cpp:3
const double GetDeltaXAtIndex(index_t index) const
Definition EdgeDiscretization.h:33
EdgeDiscretization()
Definition EdgeDiscretization.h:16
const double GetDeltaYAtIndex(index_t index) const
Definition EdgeDiscretization.h:45
Definition MeshDiscretization.h:7
index_t numberOfNodes
Definition MeshDiscretization.h:9
const std::string outOfRangeMessage
Definition MeshDiscretization.h:10