GSI_Toolbox 1.0.0 A toolbox for Gas-Surface Interaction simulations

Loading...
Searching...
No Matches
Surface.h
1
10template <typename T>
11 class Surface {
12
13 private:
14
18 Geometry<T> geometry;
19
23 Matrix<T> mu_coefficients;
24
28 Matrix<T> sigma_coefficients;
29
33 T ac_length;
34
38 T local_parameters[4];
39
40 public:
41
47 Surface();
48
55 Surface(std::string geometry_file, std::string properties_file);
56
62 ~Surface();
63
72 void import_properties(std::string properties_file);
73
79 Matrix<T> get_mu_coefficients() { return mu_coefficients; }
80
86 Matrix<T> get_sigma_coefficients() { return sigma_coefficients; }
87
93 Geometry<T>& get_geometry() { return this->geometry; }
94
100 T autocorrelation_length() { return ac_length; }
101
107 T* get_local_parameters() { return local_parameters; }
108};
109
115template <typename T>
116Surface<T>::Surface() : ac_length(0.0) {}
117
126template <typename T>
127 Surface<T>::Surface(std::string geometry_file, std::string properties_file) {
128 this->geometry = Geometry<T>(geometry_file);
129 import_properties(properties_file);
130}
131
137template <typename T>
138Surface<T>::~Surface() {
139 ac_length = 0.0;
140}
141
150template <typename T>
151 void Surface<T>::import_properties(std::string properties_file) {
152
153 unsigned int order, local_param_number;
154
155 std::ifstream myfile;
156 myfile.open(properties_file);
157 myfile >> order;
158
159 Matrix<T> mu_k(order, 1);
160 Matrix<T> sigma_k(order, 1);
161
162 // Read mu coefficients from the file.
163 for(auto i = 0; i < order; i++) {
164 myfile >> mu_k(i, 0);
165 }
166
167 // Read sigma coefficients from the file.
168 for(auto i = 0; i < order; i++) {
169 myfile >> sigma_k(i, 0);
170 }
171
172 // Read autocorrelation length from the file.
173 myfile >> this->ac_length;
174
175 this->mu_coefficients = mu_k;
176 this->sigma_coefficients = sigma_k;
177
178 myfile.close();
179}
Geometry
Class representing a geometric structure composed of vertices, normals, and properties.
Definition Geometry.h:11
Matrix
This class implements a matrix object used for linear algebra and vectorized operations.
Definition Matrix.h:25
Surface
A class representing a surface with geometry and statistical properties.
Definition Surface.h:11
Surface::autocorrelation_length
T autocorrelation_length()
Retrieves the autocorrelation length of the surface.
Definition Surface.h:100
Surface::import_properties
void import_properties(std::string properties_file)
Imports surface properties from a file.
Definition Surface.h:151
Surface::get_local_parameters
T * get_local_parameters()
Retrieves the local parameters of the surface.
Definition Surface.h:107
Surface::Surface
Surface()
Default constructor for Surface class.
Definition Surface.h:116
Surface::get_sigma_coefficients
Matrix< T > get_sigma_coefficients()
Retrieves the sigma coefficients for the surface.
Definition Surface.h:86
Surface::get_mu_coefficients
Matrix< T > get_mu_coefficients()
Retrieves the mu coefficients for the surface.
Definition Surface.h:79
Surface::~Surface
~Surface()
Destructor for Surface class.
Definition Surface.h:138
Surface::get_geometry
Geometry< T > & get_geometry()
Retrieves the geometry of the surface.
Definition Surface.h:93