4#ifndef variable_attribute_loader_h
5#define variable_attribute_loader_h
7#include <prismspf/config.h>
8#include <prismspf/core/type_enums.h>
9#include <prismspf/core/variable_attributes.h>
14PRISMS_PF_BEGIN_NAMESPACE
43 [[nodiscard]] std::map<unsigned int, variableAttributes>
103 const std::string &dependencies);
115 const std::string &dependencies);
127 const std::string &dependencies);
139 const std::string &dependencies);
149 template <
typename Iterable>
152 const Iterable &dependencies);
162 template <
typename Iterable>
165 const Iterable &dependencies);
175 template <
typename Iterable>
178 const Iterable &dependencies);
188 template <
typename Iterable>
191 const Iterable &dependencies);
197 std::map<unsigned int, variableAttributes> var_attributes;
204 validate_attributes();
211 validate_variable_name(
const std::string &name,
212 const std::set<std::string> &forbidden_names,
213 const std::string &context,
220 populate_dependencies(
221 const std::set<std::pair<std::string, std::string>> ®_delimiters,
222 const std::set<std::pair<std::string, std::string>> &dep_type_delimiters,
223 const std::string &variable_name,
225 std::set<std::string> ®_possible_deps,
226 std::map<
unsigned int, std::set<std::string>> &change_possible_deps);
232 validate_dependencies(
233 const std::set<std::string> &dependencies,
234 const std::string &context,
236 const std::string &variable_name,
237 const std::set<std::string> ®_possible_deps,
238 const std::map<
unsigned int, std::set<std::string>> &change_possible_deps);
246 validate_old_solution_dependencies();
252 strip_whitespace(
const std::string &text);
268PRISMS_PF_END_NAMESPACE
Definition variable_attribute_loader.h:260
void loadVariableAttributes() override
User-facing method where the variable attributes are set for solution fields and postprocess fields.
Class to manage the variable attributes that the user specifies.
Definition variable_attribute_loader.h:20
variableAttributeLoader()=default
Constructor.
std::map< unsigned int, variableAttributes > get_var_attributes() const
getter function for variable attributes list (copy).
Definition variable_attribute_loader.cc:59
void set_variable_equation_type(const unsigned int &index, const PDEType &pde_type)
Set the PDE type of the variable at index to pde_type where pde_typecan be EXPLICIT_TIME_DEPENDENT,...
Definition variable_attribute_loader.cc:89
void set_is_postprocessed_field(const unsigned int &index, const bool &is_postprocess)
Set the whether the field is a postprocessed field.
Definition variable_attribute_loader.cc:108
virtual ~variableAttributeLoader()=default
Destructor.
void set_variable_type(const unsigned int &index, const fieldType &field_type)
Set the field type of the variable at index to field_type where field_type can be SCALAR or VECTOR.
Definition variable_attribute_loader.cc:73
void set_dependencies_gradient_term_LHS(const unsigned int &index, const std::string &dependencies)
Add dependencies for the gradient term of the LHS equation of the variable at index.
Definition variable_attribute_loader.cc:143
void insert_dependencies_value_term_LHS(const unsigned int &index, const Iterable &dependencies)
Insert dependencies for the value term of the LHS equation of the variable at index.
Definition variable_attribute_loader.cc:173
virtual void loadVariableAttributes()
User-facing method where the variable attributes are set for solution fields and postprocess fields.
Definition variable_attribute_loader.cc:27
void insert_dependencies_value_term_RHS(const unsigned int &index, const Iterable &dependencies)
Insert dependencies for the value term of the RHS equation of the variable at index.
Definition variable_attribute_loader.cc:154
void insert_dependencies_gradient_term_LHS(const unsigned int &index, const Iterable &dependencies)
Insert dependencies for the gradient term of the LHS equation of the variable at index.
Definition variable_attribute_loader.cc:182
void set_dependencies_gradient_term_RHS(const unsigned int &index, const std::string &dependencies)
Add dependencies for the gradient term of the RHS equation of the variable at index.
Definition variable_attribute_loader.cc:124
void set_variable_name(const unsigned int &index, const std::string &name)
Set the name of the variable at index to name.
Definition variable_attribute_loader.cc:65
void insert_dependencies_gradient_term_RHS(const unsigned int &index, const Iterable &dependencies)
Insert dependencies for the gradient term of the RHS equation of the variable at index.
Definition variable_attribute_loader.cc:163
void init_variable_attributes()
Initialize the variable attributes from the two user-facing methods loadVariableAttributes() and load...
Definition variable_attribute_loader.cc:31
void set_dependencies_value_term_LHS(const unsigned int &index, const std::string &dependencies)
Add dependencies for the value term of the LHS equation of the variable at index.
Definition variable_attribute_loader.cc:134
void set_dependencies_value_term_RHS(const unsigned int &index, const std::string &dependencies)
Add dependencies for the value term of the RHS equation of the variable at index.
Definition variable_attribute_loader.cc:115