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];
bool is_second_order_var(unsigned int var) const
Real get_elem_solution_derivative() const
The derivative of the current elem_solution w.r.t.
const DenseMatrix< Number > & get_elem_jacobian() const
Const accessor for element Jacobian.
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...
Number interior_value(unsigned int var, unsigned int qp) const
const Variable & variable(unsigned int var) const
Return a constant reference to Variable var.
This class provides all data required for a physics package (e.g.
void prepare_accel(DiffContext &context)
If there are second order variables in the system, then we also prepare the accel for those variables...
const DenseVector< Number > & get_elem_solution_rate() const
Accessor for element solution rate of change w.r.t.
The libMesh namespace provides an interface to certain functionality in the library.
void compute_jacobian(const NumericVector< Number > &, SparseMatrix< Number > &J, NonlinearImplicitSystem &system)
Defines a dense subvector for use in finite element computations.
sys_type & _system
A reference to the system we are solving.
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 System & get_system() const
Accessor for associated system.
Defines a dense submatrix for use in Finite Element-type computations.
This class provides all data required for a physics package (e.g.
const std::vector< dof_id_type > & get_dof_indices() const
Accessor for element dof indices.
unsigned int n_points() const
const DenseVector< Number > & get_elem_residual() const
Const accessor for element residual.
const DenseVector< Number > & get_elem_solution_accel() const
Accessor for element solution accel of change w.r.t.
IntRange< T > make_range(T beg, T end)
The 2-parameter make_range() helper function returns an IntRange<T> when both input parameters are of...
Real get_elem_solution_rate_derivative() const
The derivative of the current elem_solution_rate w.r.t.
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...
unsigned int n_vars() const
Number of variables in solution.
void interior_rate(unsigned int var, unsigned int qp, OutputType &u) const
Real elem_solution_accel_derivative
The derivative of elem_solution_accel with respect to the current nonlinear solution, for use by systems with non default mass_residual terms.
This class forms the foundation from which generic finite elements may be derived.
const QBase & get_element_qrule() const
Accessor for element interior quadrature rule for the dimension of the current _elem.
const FEType & type() const