4#ifndef variable_attributes_h
5#define variable_attributes_h
7#include <deal.II/matrix_free/evaluation_flags.h>
9#include <prismspf/config.h>
10#include <prismspf/core/type_enums.h>
11#include <prismspf/core/types.h>
16#include <unordered_map>
18PRISMS_PF_BEGIN_NAMESPACE
26 template <
typename T,
typename U>
28 operator()(
const std::pair<T, U> &x)
const
30 return std::hash<T>()(x.first) ^ std::hash<U>()(x.second);
65#ifdef ADDITIONAL_OPTIMIZATIONS
69 mutable types::index duplicate_field_index = numbers::invalid_index;
115 std::unordered_map<std::pair<unsigned int, dependencyType>,
116 dealii::EvaluationFlags::EvaluationFlags,
125 std::unordered_map<std::pair<unsigned int, dependencyType>,
126 dealii::EvaluationFlags::EvaluationFlags,
135 dealii::EvaluationFlags::nothing;
142 dealii::EvaluationFlags::nothing;
194 std::map<unsigned int, variableAttributes> &other_var_attributes);
207 validate_dependency(
const std::string &variation,
208 dependencyType dep_type,
209 const unsigned int &other_index,
210 const std::string &context)
const;
217 compute_dependency_set(
218 const std::map<unsigned int, variableAttributes> &other_var_attributes);
225 compute_simplified_dependency_set(
226 const std::map<unsigned int, variableAttributes> &other_var_attributes);
232 find_circular_dependencies(
233 const std::map<unsigned int, variableAttributes> &other_var_attributes);
239 recursive_DFS(
const std::map<unsigned int, variableAttributes> &other_var_attributes,
240 std::set<unsigned int> &visited,
241 std::set<unsigned int> ¤t_stack,
242 const unsigned int &vertex);
245PRISMS_PF_END_NAMESPACE
Simple hash function for pairs.
Definition variable_attributes.h:24
Structure to hold the variable attributes of a field. This includes things like the name,...
Definition variable_attributes.h:39
std::set< std::string > dependencies_gradient_RHS
The user-inputted dependencies for the RHS gradient term.
Definition variable_attributes.h:86
void parse_dependencies(std::map< unsigned int, variableAttributes > &other_var_attributes)
Take user-defined dependency sets to set the evaluation flags for each variable.
Definition variable_attributes.cc:60
types::index field_index
Field index.
Definition variable_attributes.h:48
std::unordered_map< std::pair< unsigned int, dependencyType >, dealii::EvaluationFlags::EvaluationFlags, pairHash > eval_flag_set_LHS
A map of evaluation flags for the dependencies of the current variable's LHS. This will tell deal....
Definition variable_attributes.h:128
PDEType pde_type
PDE type (EXPLICIT/NONEXPLICIT).
Definition variable_attributes.h:58
std::set< std::string > dependencies_value_RHS
The user-inputted dependencies for the RHS value term.
Definition variable_attributes.h:81
std::set< std::string > dependencies_gradient_LHS
The user-inputted dependencies for the LHS gradient term.
Definition variable_attributes.h:102
std::map< unsigned int, std::map< dependencyType, fieldType > > dependency_set_RHS
A dependency set where the RHS evaluation flags that are not 0 (not nothing) are included....
Definition variable_attributes.h:149
std::set< std::string > dependencies_value_LHS
The user-inputted dependencies for the LHS value term.
Definition variable_attributes.h:97
dealii::EvaluationFlags::EvaluationFlags eval_flags_residual_RHS
Evaluation flags for the types of residual the user is expected to submit to on the RHS.
Definition variable_attributes.h:134
bool is_postprocess
Postprocess variable.
Definition variable_attributes.h:63
std::set< std::string > dependencies_LHS
The collection of value and gradient dependencies for the LHS.
Definition variable_attributes.h:108
std::map< unsigned int, std::map< dependencyType, fieldType > > dependency_set_LHS
A dependency set where the LHS evaluation flags that are not 0 (not nothing) are included....
Definition variable_attributes.h:156
std::string name
Field name.
Definition variable_attributes.h:43
std::set< unsigned int > simplified_dependency_set
A simplified set of evaluation flags for the dependencies of the current variable's LHS & RHS....
Definition variable_attributes.h:165
void format_dependencies()
Combine 'value' and 'gradient' residual dependencies to one dependency set per RHS and LHS....
Definition variable_attributes.cc:24
std::set< std::string > dependencies_RHS
The collection of value and gradient dependencies for the RHS.
Definition variable_attributes.h:92
fieldType field_type
Field type (SCALAR/VECTOR).
Definition variable_attributes.h:53
void determine_field_solve_type(std::map< unsigned int, variableAttributes > &other_var_attributes)
Using the assigned evaluation flags determine the solve type for this equation.
Definition variable_attributes.cc:197
void parse_residual_dependencies()
Take user-defined dependency sets to set the residual flags for each variable.
Definition variable_attributes.cc:36
std::unordered_map< std::pair< unsigned int, dependencyType >, dealii::EvaluationFlags::EvaluationFlags, pairHash > eval_flag_set_RHS
A map of evaluation flags for the dependencies of the current variable's RHS. This will tell deal....
Definition variable_attributes.h:118
fieldSolveType field_solve_type
Internal classification for the field solve type.
Definition variable_attributes.h:76
void print() const
Print variable attributes to summary.log.
Definition variable_attributes.cc:269
dealii::EvaluationFlags::EvaluationFlags eval_flags_residual_LHS
Evaluation flags for the types of residual the user is expected to submit to on the LHS....
Definition variable_attributes.h:141