21#include "libmesh/newmark_system.h"
22#include "libmesh/equation_systems.h"
23#include "libmesh/sparse_matrix.h"
24#include "libmesh/libmesh_logging.h"
25#include "libmesh/numeric_vector.h"
39 const std::string & name_in,
40 const unsigned int number_in) :
42 _a_0 (1./(_default_alpha*_default_timestep*_default_timestep)),
43 _a_1 (_default_delta/(_default_alpha*_default_timestep)),
44 _a_2 (1./(_default_alpha*_default_timestep)),
45 _a_3 (1./(2.*_default_alpha)-1.),
46 _a_4 (_default_delta/_default_alpha -1.),
47 _a_5 (_default_timestep/2.*(_default_delta/_default_alpha-2.)),
48 _a_6 (_default_timestep*(1.-_default_delta)),
49 _a_7 (_default_delta*_default_timestep),
50 _finished_assemble (false)
120 libmesh_not_implemented();
149 LOG_SCOPE(
"initial_conditions ()",
"NewmarkSystem");
182 LOG_SCOPE(
"update_rhs ()",
"NewmarkSystem");
217 LOG_SCOPE(
"update_u_v_a ()",
"NewmarkSystem");
250 libmesh_assert_not_equal_to (delta_T, 0.);
265 _a_0 = 1./(alpha*delta_T*delta_T);
266 _a_1 = delta/(alpha*delta_T);
267 _a_2 = 1./(alpha*delta_T);
268 _a_3 = 1./(2.*alpha)-1.;
269 _a_4 = delta/alpha -1.;
270 _a_5 = delta_T/2.*(delta/alpha-2.);
271 _a_6 = delta_T*(1.-delta);
272 _a_7 = delta*delta_T;
This is the EquationSystems class.
Parameters parameters
Data structure holding arbitrary parameters.
NumericVector< Number > * rhs
The system matrix.
SparseMatrix< Number > * matrix
The system matrix.
Manages consistently variables, degrees of freedom, coefficient vectors, matrices and linear solvers ...
virtual void assemble() override
Prepares matrix and _dof_map for matrix assembly.
virtual void clear() override
Clear all the data structures associated with the system.
bool _finished_assemble
true if the matrix assembly is finished.
virtual void assemble() override
Assemble the linear system.
virtual void reinit() override
Reinitializes the member data fields associated with the system, so that, e.g., assemble() may be use...
void initial_conditions()
Apply initial conditions.
void update_rhs()
Update the rhs.
void compute_matrix()
Compute the global matrix by adding up scaled mass damping and stiffness matrix.
static const Real _default_delta
Default Newmark delta.
Real _a_0
Constants used for the time integration.
void set_newmark_parameters(const Real delta_T=_default_timestep, const Real alpha=_default_alpha, const Real delta=_default_delta)
Set the time step size and the newmark parameter alpha and delta and calculate the constant parameter...
void update_u_v_a()
Update displacement, velocity and acceleration.
NewmarkSystem(EquationSystems &es, const std::string &name, const unsigned int number)
Constructor.
static const Real _default_timestep
Default Newmark time step.
static const Real _default_alpha
Default Newmark alpha.
virtual void clear() override
Clear all the data structures associated with the system.
Provides a uniform interface to vector storage schemes for different linear algebra libraries.
virtual void close()=0
Calls the NumericVector's internal assembly routines, ensuring that the values are consistent across ...
virtual void add_vector(const T *v, const std::vector< numeric_index_type > &dof_indices)
Computes , where v is a pointer and each dof_indices[i] specifies where to add value v[i].
virtual void scale(const T factor)=0
Scale each element of the vector by the given factor.
virtual void zero()=0
Set all entries to zero.
virtual void add(const numeric_index_type i, const T value)=0
Adds value to the vector entry specified by i.
T & set(const std::string &)
virtual void close()=0
Calls the SparseMatrix's internal assembly routines, ensuring that the values are consistent across p...
virtual void zero()=0
Set all entries to 0.
virtual void add(const numeric_index_type i, const numeric_index_type j, const T value)=0
Add value to the element (i,j).
SparseMatrix< Number > & add_matrix(std::string_view mat_name, ParallelType type=PARALLEL, MatrixBuildType mat_build_type=MatrixBuildType::AUTOMATIC)
Adds the additional matrix mat_name to this system.
const SparseMatrix< Number > & get_matrix(std::string_view mat_name) const
virtual void user_initialization()
Calls user's attached initialization function, or is overridden by the user in derived classes.
NumericVector< Number > & add_vector(std::string_view vec_name, const bool projections=true, const ParallelType type=PARALLEL)
Adds the additional vector vec_name to this system.
std::unique_ptr< NumericVector< Number > > solution
Data structure to hold solution values.
const EquationSystems & get_equation_systems() const
const NumericVector< Number > & get_vector(std::string_view vec_name) const
The libMesh namespace provides an interface to certain functionality in the library.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real