diff --git a/Mesh.cpp b/Mesh.cpp index b236e85..9c58cf0 100644 --- a/Mesh.cpp +++ b/Mesh.cpp @@ -81,6 +81,14 @@ unsigned int SquareLinearMesh::get_number_of_nodes() const { unsigned int SquareLinearMesh::get_number_of_elements() const { return ne; } + +double SquareLinearMesh::get_element_length() const { + return element_length; +} + +double SquareLinearMesh::get_element_depth() const { + return element_depth; +} void SquareLinearMesh::log_coordinates() const { if (nn < 100) { diff --git a/Mesh.h b/Mesh.h index 14dfce2..9627300 100644 --- a/Mesh.h +++ b/Mesh.h @@ -53,6 +53,8 @@ class SquareLinearMesh { double get_domain_depth() const; unsigned int get_number_of_nodes() const; unsigned int get_number_of_elements() const; + double get_element_length() const; + double get_element_depth() const; //Loggers void log_coordinates() const; diff --git a/Problem.cpp b/Problem.cpp index 461ac2a..4831451 100644 --- a/Problem.cpp +++ b/Problem.cpp @@ -438,6 +438,34 @@ double Problem::find_element_slowness(unsigned int element) { return element_mu; } + +/* =============== PML =============== */ + +void Problem::pml_set(arma::mat thickness, double saturation) { + + //Set the PML saturation + pml_saturation = saturation; + pml_thickness = thickness; + +} + +void Problem::pml_build() { + //Info: Thickness {bottom, right, top, left} in Km + + //Find thickness in terms of elements: + //unsigned int neb = static_cast(pml_thickness(0)/problem_mesh->get_element_depth()); + //unsigned int net = static_cast(pml_thickness(2)/problem_mesh->get_element_depth()); + //unsigned int ner = static_cast(pml_thickness(1)/problem_mesh->get_element_length()); + //unsigned int nel = static_cast(pml_thickness(3)/problem_mesh->get_element_length()); + + //Populating the elements map (first bottom and top, second right and left) + +} + +double Problem::pml_saturation_curve(unsigned int layer) { + return 0.1; +} + /* =============== Control methods =============== */ void Problem::set_control(unsigned int n_levels, std::vector levels, std::vector velocities_arr) { diff --git a/Problem.h b/Problem.h index 42c3314..b2c48ad 100644 --- a/Problem.h +++ b/Problem.h @@ -42,6 +42,10 @@ class Problem { arma::Mat receiver_nodes; arma::Mat source_nodes; arma::cube* solution; + arma::mat pml_thickness; + unsigned int pml_max_nlayers; + double pml_saturation; + std::map map_pml; /* =============== Public Methods =============== */ @@ -62,6 +66,7 @@ class Problem { //Solutions void solve(std::string mode); void build(); + void pml_build(); //Writers void print_levels(); @@ -76,7 +81,7 @@ class Problem { //Setters void set_control(unsigned int n_levels, std::vector levels, std::vector velocities_arr); void add_device(std::string mode, double posx, double posy, unsigned int id); - + void pml_set(arma::mat thickness, double saturation); @@ -96,6 +101,8 @@ class Problem { void find_element_stiffness(arma::mat& element_stiff, arma::mat& element_coord); void find_element_mass(arma::mat& element_mass, arma::mat& element_coord); double find_element_slowness(unsigned int element); + + double pml_saturation_curve(unsigned int layer); }; diff --git a/fwiCPP.mk b/fwiCPP.mk index 64e4fc6..5bd0d5d 100644 --- a/fwiCPP.mk +++ b/fwiCPP.mk @@ -14,7 +14,7 @@ CurrentFileName := CurrentFilePath := CurrentFileFullPath := User :=Sergio Britto -Date :=06/02/23 +Date :=13/02/23 CodeLitePath :=/home/sergiobritto/.codelite LinkerName :=/usr/bin/g++ SharedObjectLinkerName :=/usr/bin/g++ -shared -fPIC