19 #include "libmesh/diff_context.h" 20 #include "libmesh/diff_system.h" 21 #include "libmesh/diff_system.h" 22 #include "libmesh/unsteady_solver.h" 33 bool allocate_local_matrices) :
35 system_time(sys.time),
36 elem_solution_derivative(1.),
37 elem_solution_rate_derivative(1.),
38 elem_solution_accel_derivative(1.),
39 fixed_solution_derivative(0.),
40 _have_local_matrices(allocate_local_matrices),
41 _dof_indices_var(sys.
n_vars()),
47 unsigned int nv = sys.
n_vars();
57 if (allocate_local_matrices)
61 std::size_t n_qoi = sys.
n_qois();
65 for (std::size_t q=0; q != n_qoi; ++q)
68 for (
unsigned int i=0; i != nv; ++i)
72 for (std::size_t q=0; q != n_qoi; ++q)
74 if (allocate_local_matrices)
98 if (allocate_local_matrices)
99 for (
unsigned int j=0; j != nv; ++j)
130 unsigned int nv = sys.
n_vars();
135 for (
unsigned int i=0; i != nv; ++i)
150 return localized_vectors_it->second.first;
164 return localized_vectors_it->second.second[var];
DenseVector< Number > _elem_solution
Element by element components of nonlinear_solution as adjusted by a time_solver. ...
std::vector< Number > _elem_qoi
Element quantity of interest contributions.
std::vector< DenseSubVector< Number > > _elem_fixed_subsolutions
std::vector< DenseSubVector< Number > > _elem_subsolution_accels
DenseVector< Number > _elem_fixed_solution
Element by element components of nonlinear_solution at a fixed point in a timestep, for optional use by e.g.
unsigned int n_qois() const
Number of currently active quantities of interest.
std::vector< DenseVector< Number > > _elem_qoi_derivative
Element quantity of interest derivative contributions.
DenseMatrix< Number > _elem_jacobian
Element jacobian: derivatives of elem_residual with respect to elem_solution.
Real * _deltat
Defaults to nullptr, can optionally be used to point to a timestep value in the System-derived class ...
std::vector< std::vector< DenseSubVector< Number > > > _elem_qoi_subderivatives
virtual bool is_steady() const =0
Is this effectively a steady-state solver?
The libMesh namespace provides an interface to certain functionality in the library.
Defines a dense subvector for use in finite element computations.
virtual ~DiffContext()
Destructor.
std::vector< DenseSubVector< Number > > _elem_subsolution_rates
This class provides a specific system class.
void add_localized_vector(NumericVector< Number > &localized_vector, const System &sys)
Adds a vector to the map of localized vectors.
virtual unsigned int time_order() const =0
const std::set< unsigned int > & get_second_order_vars() const
bool use_fixed_solution
A boolean to be set to true by systems using elem_fixed_solution, for optional use by e...
Manages consistently variables, degrees of freedom, and coefficient vectors.
std::map< const NumericVector< Number > *, std::pair< DenseVector< Number >, std::vector< DenseSubVector< Number > > > > _localized_vectors
Contains pointers to vectors the user has asked to be localized, keyed with pairs of element localize...
DenseSubVector< Number > & get_localized_subvector(const NumericVector< Number > &localized_vector, unsigned int var)
Return a reference to DenseSubVector localization of localized_vector at variable var contained in th...
std::vector< DenseSubVector< Number > > _elem_subsolutions
This is a generic class that defines a solver to handle time integration of DifferentiableSystems.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
std::vector< std::vector< DenseSubMatrix< Number > > > _elem_subjacobians
DenseVector< Number > _elem_residual
Element residual vector.
DenseVector< Number > & get_localized_vector(const NumericVector< Number > &localized_vector)
Return a reference to DenseVector localization of localized_vector contained in the _localized_vector...
void set_deltat_pointer(Real *dt)
Points the _deltat member of this class at a timestep value stored in the creating System...
DiffContext(const System &, bool allocate_local_matrices=true)
Constructor.
DenseVector< Number > _elem_solution_accel
Element by element components of du/dt as adjusted by a time_solver.
unsigned int n_vars() const
std::vector< DenseSubVector< Number > > _elem_subresiduals
Element residual subvectors and (if _have_local_matrices) Jacobian submatrices.
TimeSolver & get_time_solver()
DenseVector< Number > _elem_solution_rate
Element by element components of du/dt as adjusted by a time_solver.