Go to the documentation of this file.
18 #include "libmesh/first_order_unsteady_solver.h"
19 #include "libmesh/diff_system.h"
20 #include "libmesh/quadrature.h"
34 FEMContext & context = cast_ref<FEMContext &>(c);
49 FEBase * elem_fe =
nullptr;
52 const std::vector<Real> & JxW = elem_fe->get_JxW();
54 const std::vector<std::vector<Real>> & phi = elem_fe->get_phi();
56 const unsigned int n_dofs = cast_int<unsigned int>
63 for (
unsigned int qp = 0; qp != n_qpoints; ++qp)
69 for (
unsigned int i = 0; i < n_dofs; i++)
71 Fu(i) += JxW[qp]*(udot-v)*phi[i][qp];
78 Kuu(i,i) += rate_factor*phi[i][qp];
79 Kuv(i,i) -= soln_factor*phi[i][qp];
81 for (
unsigned int j = i+1; j < n_dofs; j++)
83 Kuu(i,j) += rate_factor*phi[j][qp];
84 Kuu(j,i) += rate_factor*phi[j][qp];
86 Kuv(i,j) -= soln_factor*phi[j][qp];
87 Kuv(j,i) -= soln_factor*phi[j][qp];
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
void compute_jacobian(const NumericVector< Number > &, SparseMatrix< Number > &J, NonlinearImplicitSystem &system)
Defines a dense submatrix for use in Finite Element-type computations.
unsigned int n_points() const
The libMesh namespace provides an interface to certain functionality in the library.
unsigned int n_vars() const
Number of variables in solution.
void prepare_accel(DiffContext &context)
If there are second order variables in the system, then we also prepare the accel for those variables...
Real get_elem_solution_derivative() const
The derivative of the current elem_solution w.r.t.
This class forms the foundation from which generic finite elements may be derived.
const System & get_system() const
Accessor for associated system.
const FEType & type() const
const Variable & variable(unsigned int var) const
Return a constant reference to Variable var.
Real elem_solution_accel_derivative
The derivative of elem_solution_accel with respect to the current nonlinear solution,...
bool is_second_order_var(unsigned int var) const
void interior_rate(unsigned int var, unsigned int qp, OutputType &u) const
The IntRange templated class is intended to make it easy to loop over integers which are indices of a...
sys_type & _system
A reference to the system we are solving.
bool compute_second_order_eqns(bool compute_jacobian, DiffContext &c)
If there are second order variables, then we need to compute their residual equations and correspondi...
Real get_elem_solution_rate_derivative() const
The derivative of the current elem_solution_rate w.r.t.
This class provides all data required for a physics package (e.g.
void get_element_fe(unsigned int var, FEGenericBase< OutputShape > *&fe) const
Accessor for interior finite element object for variable var for the largest dimension in the mesh.
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
unsigned int get_second_order_dot_var(unsigned int var) const
For a given second order (in time) variable var, this method will return the index to the correspondi...
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
Number interior_value(unsigned int var, unsigned int qp) const
This class provides all data required for a physics package (e.g.