35 void setupBoundaryCell(
const std::vector<int>&
node_numbers,
39 void incrementVector(std::vector<int>&
vec);
40 int getNumberOfFacets()
const;
87 int numerical_layers{this->sim->m_simulation_config.getIntParameters(
"numerical_layers")};
88 double max_depth{this->sim->m_simulation_config.getDoubleParameters(
"max_depth")};
97 cl_length = this->sim->m_simulation_config.getDoubleParameters(
"cell_length");
114 std::cerr <<
"[GridOneDim]: Could not find the entries 'cell_length' or 'max_depth' within "
115 "the ini file. Please "
116 "supply one of these entries!\n";
117 throw std::runtime_error(
118 static_cast<std::string
>(
"[GridOneDim]: Could not find the entries 'cell_length' or "
119 "'max_depth' within the ini file. Please "
120 "supply one of these entries!"));
132 <<
"[GridOneDim]: Both entries 'cell_length' and 'max_depth' are present within the "
133 "ini file and result "
134 "in different lengths. Please only supply one of these entries or have them produce "
135 "the same result!\n";
136 throw std::runtime_error(
static_cast<std::string
>(
137 "[GridOneDim]: Both entries 'cell_length' and 'max_depth' are present within the ini "
139 "in different lengths. Please only supply one of these entries or have them produce "
140 "the same result!"));
164 if (this->sim->m_simulation_config.getIntParameters(
"numerical_layers") !=
depth.
size())
167 <<
"[GridOneDim]: Warning - Missmatch between number of numerical layers within "
169 "and given value in the ini! The value in the provided file will be used!\n";
170 this->sim->m_simulation_config.forceValueOverwrite(
"numerical_layers",
202 std::map<std::string_view, std::unique_ptr<GenericBoundaryCondition<T>>>
boundary_condition;
206 this->all_cells[this->all_cells.size() - 1]->setBoundaryConditions(
boundary_condition);
221 return this->sim->m_simulation_config.getIntParameters(
"number_of_facets");
225 std::cerr <<
"[GridOneDim]: " <<
e.what() <<
'\n';
226 throw BadInput(
static_cast<std::string
>(
"[GridOneDim]: ")
227 +
static_cast<std::string
>(
e.what()));
230 return static_cast<int>(this->m_poly_mesh->getNumberOfFacets());
251 cell_type = this->sim->m_simulation_config.getStringParameters(
"cell_type");
253 this->sim->m_simulation_config.getStringParameters(
"top_boundary_condition_type");
255 this->sim->m_simulation_config.getStringParameters(
"bottom_boundary_condition_type");
257 this->sim->m_simulation_config.getIntParameters(
"numerical_layers") - 1;
267 this->sim->m_field_map.insert({
"CellLength",
cell_length});
270 nr_of_facets * this->sim->m_simulation_config.getIntParameters(
"numerical_layers");
274 std::cerr <<
"[GridOneDim]: " <<
e.what() <<
'\n';
275 throw BadInput(
static_cast<std::string
>(
"[GridOneDim]: ")
276 +
static_cast<std::string
>(
e.what()));
281 std::vector<T>
areas{this->m_poly_mesh->getAreas()};
295 std::cerr <<
"[GridOneDim]: Node number out of bounds in OneDimGrid. The node number "
296 "exceeds the requested number.\n";
297 throw std::runtime_error(
static_cast<std::string
>(
298 "[GridOneDim]: Node number out of bounds in OneDimGrid. The node number "
299 "exceeds the requested number."));
Concrete implementation of a matrix class representing a Compressed Sparse Rows (CSR) matrix....
Definition CsrMatrix.h:37
CsrSparseMatrix()
Constructor for an empty CsrSparseMatrix object. Leaves all storage arrays empty but sets the flag to...
Definition CsrMatrix.h:94
This class parses csv files. Parses the files as a vector of vectors of type double where each row in...
Definition CsvParser.h:17
std::pair< int, int > size() const
Function that returns the size of the matrix as a pair in (rows, columns) format.
Definition GenericMatrix.h:120
Concrete implementation of a 1D grid on each facet of a 3D shape model (hereafter: pseudo 3D).
Definition GridOneDim.h:25
T calculateCellLength()
Calculates the uniform cell length from the specified simulation config parameters.
Definition GridOneDim.h:79
void createGrid() override
Creation function for a pseudo 3D grid, assuming a shape model is given. True 1D geometries can be co...
Definition GridOneDim.h:242
GridOneDim(SimulationClassBase< T > *sim_ptr, std::shared_ptr< ShapeBase< T > > mesh_ptr)
Constructor for a OneDimGrid object.
Definition GridOneDim.h:50