35 const std::string & name_in,
36 const unsigned int number_in) :
37 Parent (es, name_in, number_in),
40 print_solution_norms(false),
41 print_solutions(false),
42 print_residual_norms(false),
43 print_residuals(false),
44 print_jacobian_norms(false),
45 print_jacobians(false),
46 print_element_solutions(false),
47 print_element_residuals(false),
48 print_element_jacobians(false),
101 libmesh_assert_equal_to (&(
time_solver->system()),
this);
117 libmesh_assert_equal_to (&(
time_solver->system()),
this);
123 cast_ref<const UnsteadySolver &>(*(
time_solver.get()));
141 return std::unique_ptr<DiffContext>(context);
158 libmesh_assert_equal_to (&(
time_solver->system()),
this);
178 libmesh_assert_equal_to (&(
time_solver->system()),
this);
187 libmesh_assert_equal_to (&(
time_solver->system()),
this);
188 return std::make_pair(this->
time_solver->diff_solver()->max_linear_iterations,
189 this->
time_solver->diff_solver()->relative_residual_tolerance);
201 if (!second_order_vars.empty())
203 for (
const auto & var_id : second_order_vars)
206 std::string new_var_name = std::string(
"dot_")+var.
name();
208 unsigned int v_var_idx;
228 unsigned int dot_var_idx )
242 std::vector<DirichletBoundary *> new_dbcs;
244 for (
const auto & dbc : *all_dbcs)
250 std::vector<unsigned int>::const_iterator dbc_var_it =
251 std::find( dbc->variables.begin(), dbc->variables.end(), var_idx );
255 std::vector<unsigned int> vars_to_add;
256 if (dbc_var_it != dbc->variables.end())
257 vars_to_add.push_back(dot_var_idx);
259 if (!vars_to_add.empty())
267 bool is_time_evolving_bc =
false;
269 is_time_evolving_bc = dbc->f->is_time_dependent();
273 is_time_evolving_bc =
true;
275 libmesh_error_msg(
"Could not find valid boundary function!");
277 if (is_time_evolving_bc)
278 libmesh_error_msg(
"Cannot currently support time-dependent Dirichlet BC for dot variables!");
292 new_dbcs.push_back(new_dbc);
297 for (
const auto & dbc : new_dbcs)
309 unsigned int dot_var = var;
314 cast_ref<const UnsteadySolver &>(*(
time_solver.get()));
virtual void init_data() override
Manages multiples systems of equations.
virtual void assemble() override
const Variable & variable(unsigned int var) const
ConstFunction that simply returns 0.
virtual void assembly(bool get_residual, bool get_jacobian, bool apply_heterogeneous_constraints=false, bool apply_no_constraints=false) override=0
Used to specify quantities of interest in a simulation.
virtual void reinit() override
std::unique_ptr< TimeSolver > time_solver
Class for specifying Dirichlet boundary conditions as constraints.
void add_second_order_dot_vars()
void add_dot_var_dirichlet_bcs(unsigned int var_idx, unsigned int dot_var_idx)
virtual std::pair< unsigned int, Real > adjoint_solve(const QoISet &qoi_indices=QoISet()) override
virtual std::unique_ptr< DiffContext > build_context()
std::map< unsigned int, unsigned int > _second_order_dot_vars
DifferentiableQoI * diff_qoi
virtual void reinit() override
bool have_second_order_vars() const
void swap_physics(DifferentiablePhysics *&swap_physics)
DifferentiablePhysics * _diff_physics
void set_is_adjoint(bool _is_adjoint_value)
virtual unsigned int time_order() const =0
const std::set< unsigned int > & get_second_order_vars() const
A variable which is solved for in a System of equations.
const std::set< subdomain_id_type > & active_subdomains() const
unsigned int get_second_order_dot_var(unsigned int var) const
const std::set< unsigned int > & get_first_order_vars() const
virtual void time_evolving(unsigned int var)
bool have_first_order_vars() const
const DirichletBoundaries * get_dirichlet_boundaries() const
bool have_second_order_scalar_vars() const
DifferentiableSystem(EquationSystems &es, const std::string &name, const unsigned int number)
virtual void init_data() override
virtual LinearSolver< Number > * get_linear_solver() const override
virtual std::pair< unsigned int, Real > get_linear_solve_parameters() const override
void swap(Iterator &lhs, Iterator &rhs)
void add_dirichlet_boundary(const DirichletBoundary &dirichlet_boundary)
void set_deltat_pointer(Real *dt)
virtual void init_physics(const System &sys)
virtual void solve() override
virtual void clear() override
const std::string & name() const
virtual void release_linear_solver(LinearSolver< Number > *) const override
bool have_first_order_scalar_vars() const
unsigned int add_variable(const std::string &var, const FEType &type, const std::set< subdomain_id_type > *const active_subdomains=nullptr)
virtual void clear_physics()
const DofMap & get_dof_map() const
virtual std::pair< unsigned int, Real > adjoint_solve(const QoISet &qoi_indices=QoISet()) override
virtual ~DifferentiableSystem()
TimeSolver & get_time_solver()
const FEType & type() const
Manages consistently variables, degrees of freedom, coefficient vectors, and matrices for implicit sy...