6#include <deal.II/base/exceptions.h>
7#include <deal.II/numerics/vector_tools.h>
9#include <boost/geometry/core/cs.hpp>
24#include <prismspf/config.h>
30template <
unsigned int dim,
unsigned int degree,
typename number>
83 init(
const std::list<DependencyMap> &all_dependeny_sets)
119 if (
solve_context->get_simulation_timer().get_increment() == 0 &&
127 if (
solve_context->get_simulation_timer().get_increment() == 0)
129 solutions.apply_initial_condition_for_old_fields();
157 solutions.prepare_for_solution_transfer();
182 for (
const auto &global_index :
solve_block.field_indices)
184 bool initialized_from_file =
false;
187 const auto &initial_condition_parameters =
190 for (
const auto &initial_condition_file :
191 initial_condition_parameters.get_initial_condition_files())
194 std::find(initial_condition_file.simulation_variable_names.begin(),
195 initial_condition_file.simulation_variable_names.end(),
197 if (name_it != initial_condition_file.simulation_variable_names.end())
200 solutions.get_solution_vector(global_index).zero_out_ghost_values();
201 dealii::VectorTools::interpolate(
203 solve_context->get_dof_manager().get_field_dof_handler(global_index),
206 solve_context->get_field_attributes()[global_index].field_type,
207 initial_condition_file,
209 solutions.get_solution_vector(global_index));
211 initialized_from_file =
true;
216 if (!initialized_from_file)
218 solutions.get_solution_vector(global_index).zero_out_ghost_values();
219 dealii::VectorTools::interpolate(
221 solve_context->get_dof_manager().get_field_dof_handler(global_index),
224 solve_context->get_field_attributes()[global_index].field_type,
226 solutions.get_solution_vector(global_index));
229 solutions.apply_initial_condition_for_old_fields();
279PRISMS_PF_END_NAMESPACE
Class that manages solution initialization and swapping with old solutions.
Definition group_solution_handler.h:72
Function for user-implemented initial conditions. These are only ever calculated for explicit time de...
Definition initial_conditions.h:37
Function for read-in of initial conditions.
Definition initial_conditions.h:69
Structure to hold the attributes of a solve-block.
Definition solve_block.h:56
This class provides context for a solver with ptrs to all the relevant dependencies.
Definition solve_context.h:36
void execute_solution_transfer()
Execute solution transfer (for AMR).
Definition solver_base.h:164
void set_initial_condition()
Set the initial conditions.
Definition solver_base.h:180
virtual void reinit()
Reinitialize the solution vectors & apply constraints.
Definition solver_base.h:98
const SolveBlock & get_solve_block() const
Get the solver context.
Definition solver_base.h:255
virtual void update()
Update the fields.
Definition solver_base.h:137
std::vector< SolverBase< dim, degree, number > * > aux_solvers
Definition solver_base.h:276
const GroupSolutionHandler< dim, number > & get_solution_manager() const
Get the solution handler.
Definition solver_base.h:237
virtual void solve()
Solve for a single update step.
Definition solver_base.h:117
virtual void print()
Print information about the solver to summary.log.
Definition solver_base.h:173
void prepare_for_solution_transfer()
Prepare for solution transfer (for AMR).
Definition solver_base.h:155
virtual ~SolverBase()=default
Destructor.
SolverBase(const SolverBase &solver_base)=delete
Copy constructor.
SolverBase(SolverBase &&solver_base) noexcept=delete
Move constructor.
SolverBase(SolveBlock _solve_block, const SolveContext< dim, degree, number > &_solve_context)
Constructor.
Definition solver_base.h:37
virtual void init(const std::list< DependencyMap > &all_dependeny_sets)
Initialize the solver.
Definition solver_base.h:83
SolverBase & operator=(SolverBase &&solver_base) noexcept=delete
Move assignment.
GroupSolutionHandler< dim, number > solutions
Solution vectors for fields handled by this solver.
Definition solver_base.h:274
const SolveContext< dim, degree, number > * solve_context
Solver context provides access to external information.
Definition solver_base.h:269
virtual void solve_level(unsigned int relative_level=0)
Solve one level.
Definition solver_base.h:110
SolveBlock solve_block
Information about the solve block this handler is responsible for.
Definition solver_base.h:264
SolverBase & operator=(const SolverBase &solver_base)=delete
Copy assignment.
virtual void update_ghosts()
Update the ghosts.
Definition solver_base.h:146
GroupSolutionHandler< dim, number > & get_solution_manager()
Get the solution handler.
Definition solver_base.h:246
static const dealii::MappingQ1< dim > mapping
Mappings to and from reference cell.
Definition system_wide.h:36
Definition conditional_ostreams.cc:20
Definition vectorized_operations.h:17
@ Primary
Primary fields are initialized explicitly through initial conditions rather than through the solver o...
Definition solve_block.h:30
Information about what fields need to be held onto. This will likely get refactored to be an oldest a...
Definition dependency_extents.h:31
unsigned int oldest_age
Definition dependency_extents.h:32