6#include <deal.II/base/exceptions.h>
7#include <deal.II/matrix_free/evaluation_flags.h>
13#include <prismspf/config.h>
58 using EvalFlags = dealii::EvaluationFlags::EvaluationFlags;
64 std::set<Types::Index> _field_indices = {},
121 return id < other.
id;
131 "A valid solve type must be selected (Constant | Explicit | Linear | Newton)\n"));
133 dealii::ExcMessage(
"This solve block must manage at least 1 field.\n"));
140 dealii::ExcMessage(
"Every field in a newton solve should appear "
141 "in the residual (RHS) expression.\n"));
142 AssertThrow(dep_it_rhs->second.flag != EvalFlags::nothing,
143 dealii::ExcMessage(
"Every field in a newton solve should appear "
144 "in the residual (RHS) expression.\n"));
148 "Every field in a newton solve should appear as a Delta term"
149 "in the residual Jacobian (LHS) expression.\n"));
150 AssertThrow(dep_it_lhs->second.src_flag != EvalFlags::nothing,
152 "Every field in a newton solve should appear as a Delta term"
153 "in the residual Jacobian (LHS) expression.\n"));
163 "Every field in a linear solve should appear "
164 "in the (LHS) expression. Be sure to use the src_flag.\n"));
165 AssertThrow(dep_it_lhs->second.src_flag != EvalFlags::nothing,
167 "Every field in a linear solve should appear "
168 "in the (LHS) expression. Be sure to use the src_flag.\n"));
174 dealii::ExcMessage(
"Explicit solves do not have an LHS, "
175 "and should have no LHS dependencies.\n"));
180 dealii::ExcMessage(
"Constant \"solves\" do not have an RHS or LHS, "
181 "and should have no dependencies.\n"));
185 AssertThrow(dependency.src_flag == EvalFlags::nothing,
187 "Trial/Change terms should not appear in RHS expressions.\n"));
200PRISMS_PF_END_NAMESPACE
Structure to hold the attributes of a solve-block.
Definition solve_block.h:56
SolveType solve_type
PDE type (Constant | Explicit | Linear | Newton).
Definition solve_block.h:84
bool has_auxiliary_solve() const
Definition solve_block.h:113
SolveTiming solve_timing
This is used to determine whether to initialize the solution vector with the initial conditions or ju...
Definition solve_block.h:90
int id
Unique identifier. Use this in 'if' statements or switch cases in equations lhs and rhs.
Definition solve_block.h:79
SolveBlock(int _id=-1, SolveType _solve_type=Explicit, SolveTiming _solve_timing=Primary, std::set< Types::Index > _field_indices={}, DependencyMap _dependencies_rhs={}, DependencyMap _dependencies_lhs={})
Definition solve_block.h:61
TensorRank FieldType
Definition solve_block.h:59
DependencyMap dependencies_rhs
Dependencies for the rhs equation(s)
Definition solve_block.h:100
std::vector< SolveBlock > aux_solve_container
Solves that occur inside the parent solve. This is only really meant for implicit solves with higher ...
Definition solve_block.h:110
dealii::EvaluationFlags::EvaluationFlags EvalFlags
Definition solve_block.h:58
DependencyMap dependencies_lhs
Dependencies for the lhs equation(s)
Definition solve_block.h:104
void validate() const
Definition solve_block.h:125
bool operator<(const SolveBlock &other) const
Definition solve_block.h:119
std::set< Types::Index > field_indices
Indices of the fields to be solved in this block.
Definition solve_block.h:95
std::map< Types::Index, Dependency > DependencyMap
Definition dependencies.h:129
Definition conditional_ostreams.cc:20
SolveBlock SolveGroup
Definition solve_block.h:196
SolveTiming
Enum describing when each block of fields gets solved.
Definition solve_block.h:25
@ Uninitialized
Definition solve_block.h:37
@ Primary
Primary fields are initialized explicitly through initial conditions rather than through the solver o...
Definition solve_block.h:30
@ NucleationRate
NucleationRate fields are only solved on nucleation attempt and output increments.
Definition solve_block.h:46
@ PostProcess
PostProcess fields are only solved on output increments.
Definition solve_block.h:41
@ Initialized
Definition solve_block.h:31
@ Secondary
Secondary fields are only evaluated by the pde solver on every increment, not initialized by a separa...
Definition solve_block.h:36
SolveType
Type of PDE that is being solved.
Definition type_enums.h:17
@ Linear
Definition type_enums.h:33
@ Newton
Definition type_enums.h:43
@ Constant
Definition type_enums.h:21
@ Explicit
Definition type_enums.h:26
TensorRank
Tensor rank of the field.
Definition type_enums.h:52