29 #include "libmesh/numeric_vector.h" 48 const std::vector<libMesh::NumericVector<Real>*>& sols){
50 libmesh_assert_equal_to(sols.size(), 3);
52 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
57 sol = RealVectorX::Zero(n_dofs),
58 vel = RealVectorX::Zero(n_dofs),
59 accel = RealVectorX::Zero(n_dofs);
63 const libMesh::NumericVector<Real>
64 &sol_global = *sols[0],
65 &vel_global = *sols[1],
66 &acc_global = *sols[2];
68 for (
unsigned int i=0; i<n_dofs; i++) {
70 sol(i) = sol_global(dof_indices[i]);
71 vel(i) = vel_global(dof_indices[i]);
72 accel(i) = acc_global(dof_indices[i]);
75 _assembly_ops->set_elem_solution(sol);
76 _assembly_ops->set_elem_velocity(vel);
77 _assembly_ops->set_elem_acceleration(accel);
85 const std::vector<libMesh::NumericVector<Real>*>& sols,
86 std::vector<RealVectorX>& local_sols) {
88 libmesh_assert_equal_to(sols.size(), 3);
90 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
97 &accel = local_sols[2];
99 sol = RealVectorX::Zero(n_dofs);
100 vel = RealVectorX::Zero(n_dofs);
101 accel = RealVectorX::Zero(n_dofs);
105 const libMesh::NumericVector<Real>
106 &sol_global = *sols[0],
107 &vel_global = *sols[1],
108 &acc_global = *sols[2];
110 for (
unsigned int i=0; i<n_dofs; i++) {
112 sol(i) = sol_global(dof_indices[i]);
113 vel(i) = vel_global(dof_indices[i]);
114 accel(i) = acc_global(dof_indices[i]);
125 const std::vector<libMesh::NumericVector<Real>*>& sols){
127 libmesh_assert_equal_to(sols.size(), 3);
129 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
134 sol = RealVectorX::Zero(n_dofs),
135 vel = RealVectorX::Zero(n_dofs),
136 accel = RealVectorX::Zero(n_dofs);
140 const libMesh::NumericVector<Real>
141 &sol_global = *sols[0],
142 &vel_global = *sols[1],
143 &acc_global = *sols[2];
145 for (
unsigned int i=0; i<n_dofs; i++) {
147 sol(i) = sol_global(dof_indices[i]);
148 vel(i) = vel_global(dof_indices[i]);
149 accel(i) = acc_global(dof_indices[i]);
152 _assembly_ops->set_elem_perturbed_solution(sol);
153 _assembly_ops->set_elem_perturbed_velocity(vel);
154 _assembly_ops->set_elem_perturbed_acceleration(accel);
163 const libMesh::NumericVector<Real>& sol) {
165 const libMesh::NumericVector<Real>
172 vec.add( -1., prev_sol);
185 const libMesh::NumericVector<Real>& sol) {
187 const libMesh::NumericVector<Real>
194 vec.add( -1., prev_sol);
196 vec.add( -1./
beta/
dt, prev_vel);
206 const libMesh::NumericVector<Real>& sol) {
208 const libMesh::NumericVector<Real>
215 vec.add( -1., prev_sol);
227 const libMesh::NumericVector<Real>& sol) {
229 const libMesh::NumericVector<Real>
236 vec.add( -1., prev_sol);
238 vec.add( -1./
beta/
dt, prev_vel);
249 const libMesh::NumericVector<Real>& sol) {
263 const libMesh::NumericVector<Real>& sol) {
282 unsigned int n_dofs = (
unsigned int)vec.size();
285 f_x = RealVectorX::Zero(n_dofs),
286 f_m = RealVectorX::Zero(n_dofs);
289 f_m_jac_xddot = RealMatrixX::Zero(n_dofs, n_dofs),
290 f_m_jac_xdot = RealMatrixX::Zero(n_dofs, n_dofs),
291 f_m_jac = RealMatrixX::Zero(n_dofs, n_dofs),
292 f_x_jac_xdot = RealMatrixX::Zero(n_dofs, n_dofs),
293 f_x_jac = RealMatrixX::Zero(n_dofs, n_dofs);
296 _assembly_ops->elem_calculations(if_jac,
306 if (_if_highest_derivative_solution) {
371 mat = ((1./
beta/
dt/
dt) * f_m_jac_xddot +
373 (f_m_jac + f_x_jac));
384 libmesh_assert(_assembly_ops);
387 _assembly_ops->linearized_jacobian_solution_product(vec);
399 libmesh_assert(_assembly_ops);
400 unsigned int n_dofs = (
unsigned int)vec.size();
403 f_x = RealVectorX::Zero(n_dofs),
404 f_m = RealVectorX::Zero(n_dofs);
407 _assembly_ops->elem_sensitivity_calculations(f,
422 if (_if_highest_derivative_solution)
return;
425 libmesh_assert(_assembly_ops);
426 libmesh_assert_equal_to(prev_sols.size(), 3);
428 unsigned int n_dofs = (
unsigned int)vec.size();
433 &accel = prev_sols[2];
435 dummy_vec = RealVectorX::Zero(n_dofs);
438 f_m_jac_xdot = RealMatrixX::Zero(n_dofs, n_dofs),
439 dummy_mat = RealMatrixX::Zero(n_dofs, n_dofs);
442 _assembly_ops->elem_calculations(
true,
449 libmesh_assert(
false);
459 libmesh_assert(
false);
468 libmesh_assert(
false);
478 libmesh_assert(
false);
virtual void elem_sensitivity_contribution_previous_timestep(const std::vector< RealVectorX > &prev_sols, RealVectorX &vec)
computes the contribution for this element from previous time step
virtual void update_delta_acceleration(libMesh::NumericVector< Real > &acc, const libMesh::NumericVector< Real > &sol)
update the perturbation in transient acceleration based on the current perturbed solution ...
virtual void update_acceleration(libMesh::NumericVector< Real > &vec, const libMesh::NumericVector< Real > &sol)
update the transient acceleration based on the current solution
virtual void update_sensitivity_velocity(libMesh::NumericVector< Real > &vel, const libMesh::NumericVector< Real > &sol)
update the transient sensitivity velocity based on the current sensitivity solution ...
virtual void elem_calculations(bool if_jac, RealVectorX &vec, RealMatrixX &mat)
performs the element calculations over elem, and returns the element vector and matrix quantities in ...
libMesh::NumericVector< Real > & solution(unsigned int prev_iter=0) const
virtual void elem_sensitivity_calculations(const MAST::FunctionBase &f, RealVectorX &vec)=0
performs the element sensitivity calculations over elem, and returns the element residual sensitivity...
libMesh::NumericVector< Real > & solution_sensitivity(unsigned int prev_iter=0) const
libMesh::NumericVector< Real > & acceleration_sensitivity(unsigned int prev_iter=0) const
virtual void set_element_perturbed_data(const std::vector< libMesh::dof_id_type > &dof_indices, const std::vector< libMesh::NumericVector< Real > *> &sols)
provides the element with the transient data for calculations
virtual void update_delta_velocity(libMesh::NumericVector< Real > &vel, const libMesh::NumericVector< Real > &sol)
update the perturbation in transient velocity based on the current perturbed solution ...
Matrix< Real, Dynamic, Dynamic > RealMatrixX
libMesh::NumericVector< Real > & velocity(unsigned int prev_iter=0) const
virtual void elem_shape_sensitivity_calculations(const MAST::FunctionBase &f, RealVectorX &vec)=0
performs the element shape sensitivity calculations over elem, and returns the element residual sensi...
Real gamma
parameter used by this solver.
libMesh::NumericVector< Real > & acceleration(unsigned int prev_iter=0) const
virtual void elem_topology_sensitivity_calculations(const MAST::FunctionBase &f, RealVectorX &vec)=0
performs the element topology sensitivity calculations over elem, and returns the element residual se...
Matrix< Real, Dynamic, 1 > RealVectorX
virtual void update_sensitivity_acceleration(libMesh::NumericVector< Real > &acc, const libMesh::NumericVector< Real > &sol)
update the transient sensitivity acceleration based on the current sensitivity solution ...
MAST::AssemblyBase * _assembly
virtual void update_velocity(libMesh::NumericVector< Real > &vec, const libMesh::NumericVector< Real > &sol)
update the transient velocity based on the current solution
virtual ~SecondOrderNewmarkTransientSolver()
SecondOrderNewmarkTransientSolver()
virtual void set_element_data(const std::vector< libMesh::dof_id_type > &dof_indices, const std::vector< libMesh::NumericVector< Real > *> &sols)
provides the element with the transient data for calculations
Real beta
parameter used by this solver.
libMesh::NumericVector< Real > & velocity_sensitivity(unsigned int prev_iter=0) const
virtual void elem_linearized_jacobian_solution_product(RealVectorX &vec)=0
performs the element calculations over elem, and returns the element vector quantity in vec...
virtual void extract_element_sensitivity_data(const std::vector< libMesh::dof_id_type > &dof_indices, const std::vector< libMesh::NumericVector< Real > *> &sols, std::vector< RealVectorX > &local_sols)
provides the element with the sensitivity of transient data for calculations