29 #include "libmesh/numeric_vector.h" 60 this->
beta = .25 * std::pow(1. -
alpha_m + alpha_f, 2);
68 const std::vector<libMesh::NumericVector<Real>*>& sols){
70 libmesh_assert_equal_to(sols.size(), 3);
72 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
77 sol = RealVectorX::Zero(n_dofs),
78 vel = RealVectorX::Zero(n_dofs),
79 accel = RealVectorX::Zero(n_dofs);
83 const libMesh::NumericVector<Real>
84 &sol_global = *sols[0],
85 &vel_global = *sols[1],
86 &acc_global = *sols[2],
92 for (
unsigned int i=0; i<n_dofs; i++) {
94 sol(i) = ((1.-
alpha_f)*sol_global(dof_indices[i]) +
95 alpha_f*prev_sol(dof_indices[i]));
96 vel(i) = ((1.-
alpha_f)*vel_global(dof_indices[i]) +
97 alpha_f*prev_vel(dof_indices[i]));
98 accel(i) = ((1.-
alpha_m)*acc_global(dof_indices[i]) +
99 alpha_m*prev_acc(dof_indices[i]));
102 _assembly_ops->set_elem_solution(sol);
103 _assembly_ops->set_elem_velocity(vel);
104 _assembly_ops->set_elem_acceleration(accel);
112 const std::vector<libMesh::NumericVector<Real>*>& sols,
113 std::vector<RealVectorX>& local_sols) {
115 libmesh_assert_equal_to(sols.size(), 3);
117 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
119 local_sols.resize(3);
122 &sol = local_sols[0],
123 &vel = local_sols[1],
124 &accel = local_sols[2];
126 sol = RealVectorX::Zero(n_dofs);
127 vel = RealVectorX::Zero(n_dofs);
128 accel = RealVectorX::Zero(n_dofs);
132 const libMesh::NumericVector<Real>
133 &sol_global = *sols[0],
134 &vel_global = *sols[1],
135 &acc_global = *sols[2],
140 for (
unsigned int i=0; i<n_dofs; i++) {
142 sol(i) = ((1.-
alpha_f)*sol_global(dof_indices[i]) +
143 alpha_f*prev_sol(dof_indices[i]));
144 vel(i) = ((1.-
alpha_f)*vel_global(dof_indices[i]) +
145 alpha_f*prev_vel(dof_indices[i]));
146 accel(i) = ((1.-
alpha_m)*acc_global(dof_indices[i]) +
147 alpha_m*prev_acc(dof_indices[i]));
158 const std::vector<libMesh::NumericVector<Real>*>& sols){
160 libmesh_assert_equal_to(sols.size(), 3);
162 const unsigned int n_dofs = (
unsigned int)dof_indices.size();
167 sol = RealVectorX::Zero(n_dofs),
168 vel = RealVectorX::Zero(n_dofs),
169 accel = RealVectorX::Zero(n_dofs);
173 const libMesh::NumericVector<Real>
174 &sol_global = *sols[0],
175 &vel_global = *sols[1],
176 &acc_global = *sols[2];
178 for (
unsigned int i=0; i<n_dofs; i++) {
180 sol(i) = sol_global(dof_indices[i]);
181 vel(i) = vel_global(dof_indices[i]);
182 accel(i) = acc_global(dof_indices[i]);
185 _assembly_ops->set_elem_perturbed_solution(sol);
186 _assembly_ops->set_elem_perturbed_velocity(vel);
187 _assembly_ops->set_elem_perturbed_acceleration(accel);
200 unsigned int n_dofs = (
unsigned int)vec.size();
203 f_x = RealVectorX::Zero(n_dofs),
204 f_m = RealVectorX::Zero(n_dofs);
207 f_m_jac_xddot = RealMatrixX::Zero(n_dofs, n_dofs),
208 f_m_jac_xdot = RealMatrixX::Zero(n_dofs, n_dofs),
209 f_m_jac = RealMatrixX::Zero(n_dofs, n_dofs),
210 f_x_jac_xdot = RealMatrixX::Zero(n_dofs, n_dofs),
211 f_x_jac = RealMatrixX::Zero(n_dofs, n_dofs);
214 _assembly_ops->elem_calculations(if_jac,
224 if (_if_highest_derivative_solution) {
296 (1.-
alpha_f) * (f_m_jac + f_x_jac));
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 ...
virtual ~GeneralizedAlphaTransientSolver()
Real alpha_f
parameter used by this solver.
This class implements the Newmark solver for solution of a second-order ODE.
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
void update_coefficient(Real rho_infinity)
Computes the value of coefficients basde on value of .
libMesh::NumericVector< Real > & solution_sensitivity(unsigned int prev_iter=0) const
libMesh::NumericVector< Real > & velocity(unsigned int prev_iter=0) const
Matrix< Real, Dynamic, Dynamic > RealMatrixX
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
Real alpha_m
parameter used by this solver.
Real gamma
parameter used by this solver.
libMesh::NumericVector< Real > & velocity_sensitivity(unsigned int prev_iter=0) const
GeneralizedAlphaTransientSolver()
Matrix< Real, Dynamic, 1 > RealVectorX
libMesh::NumericVector< Real > & acceleration_sensitivity(unsigned int prev_iter=0) const
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
libMesh::NumericVector< Real > & solution(unsigned int prev_iter=0) const
Real rho_inf
parameter used by this solver.
MAST::AssemblyBase * _assembly
Real beta
parameter used by this solver.
libMesh::NumericVector< Real > & acceleration(unsigned int prev_iter=0) const