31 #include "libmesh/dof_map.h" 32 #include "libmesh/numeric_vector.h" 37 _thermal_assembly (nullptr) {
61 const libMesh::NumericVector<Real>& adj_sol) {
86 std::vector<libMesh::dof_id_type> dof_indices;
87 const libMesh::DofMap& dof_map =
_system->
system().get_dof_map();
92 str_sol = RealVectorX::Zero(dof_indices.size());
95 for (
unsigned int i=0; i<dof_indices.size(); i++)
96 str_sol(i) = (*_structural_sol)(dof_indices[i]);
120 std::vector<libMesh::dof_id_type> dof_indices;
121 const libMesh::DofMap& dof_map =
_system->
system().get_dof_map();
123 dof_map.dof_indices (&e, dof_indices);
126 str_adj = RealVectorX::Zero(dof_indices.size());
129 mat = RealMatrixX::Zero(dof_indices.size(), dq_dX.size());
132 for (
unsigned int i=0; i<dof_indices.size(); i++)
133 str_adj(i) = (*_structural_adjoint)(dof_indices[i]);
145 dq_dX += str_adj.transpose() * mat;
virtual ~StressTemperatureAdjoint()
MAST::NonlinearSystem & system()
bool primal_data_initialized() const
bool stress_plot_mode() const
Data structure provides the mechanism to store stress and strain output from a structural analysis...
virtual bool if_evaluate_for_element(const MAST::GeomElem &elem) const
checks to see if the object has been told about the subset of elements and if the specified element i...
MAST::AssemblyBase * _thermal_assembly
const MAST::GeomElem & elem() const
virtual void output_derivative_for_elem(RealVectorX &dq_dX)
calculates the derivative of p-norm von Mises stress for the norm identified using set_p_val()...
MAST::StressStrainOutputBase & _stress
MAST::ElementBase * _physics_elem
virtual void thermal_residual_temperature_derivative(const MAST::FEBase &fe_thermal, RealMatrixX &m)=0
virtual const libMesh::Elem & get_reference_elem() const
StressTemperatureAdjoint(MAST::StressStrainOutputBase &stress)
default constructor
Matrix< Real, Dynamic, Dynamic > RealMatrixX
MAST::BoundaryConditionBase * get_thermal_load_for_elem(const MAST::GeomElem &elem)
Matrix< Real, Dynamic, 1 > RealVectorX
virtual void functional_state_derivartive_for_elem(const libMesh::dof_id_type e_id, RealVectorX &dq_dX) const
calculates and returns the derivative of von Mises p-norm functional wrt state vector for the specifi...
std::unique_ptr< libMesh::NumericVector< Real > > build_localized_vector(const libMesh::System &sys, const libMesh::NumericVector< Real > &global) const
localizes the parallel vector so that the local copy stores all values necessary for calculation of t...
MAST::AssemblyBase * _assembly
void set_thermal_assembly(MAST::AssemblyBase &thermal_assembly)
void set_structural_solutions(const libMesh::NumericVector< Real > &sol, const libMesh::NumericVector< Real > &adj_sol)
virtual void calculate_stress_temperature_derivative(MAST::FEBase &fe_thermal, MAST::StressStrainOutputBase &output)=0
virtual void set_solution(const RealVectorX &vec, bool if_sens=false)
stores vec as solution for element level calculations, or its sensitivity if if_sens is true...
virtual void set_elem_solution(const RealVectorX &sol)
sets the element solution
std::unique_ptr< libMesh::NumericVector< Real > > _structural_sol
virtual std::unique_ptr< MAST::FEBase > init_fe(bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object with the order of quadrature rule...
std::unique_ptr< libMesh::NumericVector< Real > > _structural_adjoint
MAST::SystemInitialization * _system