37 const libMesh::Point& qp,
38 const libMesh::Point& xyz,
48 libmesh_assert_equal_to(stress.size(), 6);
49 libmesh_assert_equal_to(strain.size(), 6);
91 libmesh_assert_equal_to(dstress_dX.rows(), 6);
92 libmesh_assert_equal_to(dstrain_dX.rows(), 6);
128 libmesh_assert_equal_to(dstress_df.size(), 6);
129 libmesh_assert_equal_to(dstrain_df.size(), 6);
141 std::map<const MAST::FunctionBase*, RealVectorX>::const_iterator
153 std::map<const MAST::FunctionBase*, RealVectorX>::const_iterator
169 std::map<const MAST::FunctionBase*, RealVectorX>::const_iterator
184 libmesh_assert_equal_to(
_stress.size(), 6);
201 libmesh_assert_equal_to(
_stress.size(), 6);
238 libmesh_assert_equal_to(
_stress.size(), 6);
264 6.0 * (dstress_dp(3) *
_stress(3)+
266 dstress_dp(5) *
_stress(5))) * 0.5 * pow(p, -0.5);
376 (
_physics_elem)->calculate_stress_boundary_velocity(f, *
this,
457 const libMesh::Elem& ref_elem,
491 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::iterator
495 for ( ; map_it != map_end; map_it++) {
498 std::vector<MAST::StressStrainOutputBase::Data*>::iterator
499 it = map_it->second.begin(),
500 end = map_it->second.end();
502 for ( ; it != end; it++)
505 map_it->second.clear();
514 for ( ; map_it != map_end; map_it++) {
517 std::vector<MAST::StressStrainOutputBase::Data*>::iterator
518 it = map_it->second.begin(),
519 end = map_it->second.end();
521 for ( ; it != end; it++)
524 map_it->second.clear();
544 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::iterator
548 for ( ; map_it != map_end; map_it++) {
551 std::vector<MAST::StressStrainOutputBase::Data*>::iterator
552 it = map_it->second.begin(),
553 end = map_it->second.end();
555 for ( ; it != end; it++)
556 (*it)->clear_sensitivity_data();
563 for ( ; map_it != map_end; map_it++) {
566 std::vector<MAST::StressStrainOutputBase::Data*>::iterator
567 it = map_it->second.begin(),
568 end = map_it->second.end();
570 for ( ; it != end; it++)
584 const unsigned int qp,
585 const libMesh::Point& quadrature_pt,
586 const libMesh::Point& physical_pt,
606 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::iterator
612 _stress_data.insert(std::pair<
const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >
614 std::vector<MAST::StressStrainOutputBase::Data*>())).first;
618 libmesh_assert_equal_to(qp, it->second.size());
620 it->second.push_back(d);
631 const unsigned int s,
632 const unsigned int qp,
633 const libMesh::Point& quadrature_pt,
634 const libMesh::Point& physical_pt,
654 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::iterator
661 (std::pair<
const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >
663 std::vector<MAST::StressStrainOutputBase::Data*>())).first;
667 libmesh_assert_equal_to(qp, it->second.size());
669 it->second.push_back(d);
677 const std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >&
688 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*>>::const_iterator
696 for ( ; it != end; it++) {
698 std::vector<MAST::StressStrainOutputBase::Data*>::const_iterator
699 s_it = it->second.begin(),
700 s_end = it->second.end();
702 for ( ; s_it != s_end; s_it++) {
703 vm = (*s_it)->von_Mises_stress();
704 max_vm = vm>max_vm?vm:max_vm;
722 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
726 n = (
unsigned int)it->second.size();
739 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
743 n = (
unsigned int)it->second.size();
750 const std::vector<MAST::StressStrainOutputBase::Data*>&
755 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
769 const unsigned int qp) {
773 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
779 libmesh_assert_less(qp, it->second.size());
781 return *(it->second[qp]);
799 std::pair<std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>::const_iterator,
800 std::multimap<libMesh::subdomain_id_type, MAST::BoundaryConditionBase*>::const_iterator> it;
806 for ( ; it.first != it.second; it.first++)
810 libmesh_assert(!rval);
812 rval = it.first->second;
826 libmesh_assert_greater(
_sigma0, 0.);
841 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
845 for ( ; map_it != map_end; map_it++) {
847 std::vector<MAST::StressStrainOutputBase::Data*>::const_iterator
848 vec_it = map_it->second.begin(),
849 vec_end = map_it->second.end();
851 for ( ; vec_it != vec_end; vec_it++) {
854 e_val = (*vec_it)->von_Mises_stress();
855 JxW = (*vec_it)->quadrature_point_JxW();
863 exp_sp = exp(
_rho * sp);
883 Real& dsigma_vm_val_df)
const {
891 dsigma_vm_val_df = 0.;
894 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
898 for ( ; map_it != map_end; map_it++) {
901 dsigma_vm_val_df += val;
915 Real& dsigma_vm_val_df)
const {
923 dsigma_vm_val_df = 0.;
926 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
930 for ( ; map_it != map_end; map_it++) {
933 dsigma_vm_val_df += val;
946 const libMesh::dof_id_type e_id,
947 Real& dsigma_vm_val_df)
const {
951 libmesh_assert_greater(
_sigma0, 0.);
965 dsigma_vm_val_df = 0.;
968 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
972 libmesh_assert(map_it != map_end);
974 std::vector<MAST::StressStrainOutputBase::Data*>::const_iterator
975 vec_it = map_it->second.begin(),
976 vec_end = map_it->second.end();
978 for ( ; vec_it != vec_end; vec_it++) {
981 e_val = (*vec_it)->von_Mises_stress();
982 de_val = (*vec_it)->dvon_Mises_stress_dp(f);
983 JxW = (*vec_it)->quadrature_point_JxW();
997 exp_sp = exp(
_rho * sp_weight);
999 num_sens += (de_val/
_sigma0 * JxW * exp_sp *
1017 const libMesh::dof_id_type e_id,
1018 Real& dsigma_vm_val_df)
const {
1022 libmesh_assert_greater(
_sigma0, 0.);
1032 dsigma_vm_val_df = 0.;
1035 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
1039 libmesh_assert(map_it != map_end);
1041 std::vector<MAST::StressStrainOutputBase::Data*>::const_iterator
1042 vec_it = map_it->second.begin(),
1043 vec_end = map_it->second.end();
1045 for ( ; vec_it != vec_end; vec_it++) {
1048 e_val = (*vec_it)->von_Mises_stress();
1049 JxW_Vn = (*vec_it)->quadrature_point_JxW();
1057 exp_sp = exp(
_rho * sp);
1058 denom_sens += exp_sp * JxW_Vn;
1074 libmesh_assert_greater(
_sigma0, 0.);
1086 denom_sens = RealVectorX::Zero(dq_dX.size()),
1087 num_sens = RealVectorX::Zero(dq_dX.size()),
1088 de_val = RealVectorX::Zero(dq_dX.size());
1094 std::map<const libMesh::dof_id_type, std::vector<MAST::StressStrainOutputBase::Data*> >::const_iterator
1099 libmesh_assert(map_it != map_end);
1101 std::vector<MAST::StressStrainOutputBase::Data*>::const_iterator
1102 vec_it = map_it->second.begin(),
1103 vec_end = map_it->second.end();
1106 for ( ; vec_it != vec_end; vec_it++) {
1109 e_val = (*vec_it)->von_Mises_stress();
1110 de_val = (*vec_it)->dvon_Mises_stress_dX();
1111 JxW = (*vec_it)->quadrature_point_JxW();
1122 denom_sens += 0. * de_val;
1127 exp_sp = exp(
_rho * sp_weight);
1129 num_sens += (de_val/
_sigma0 * JxW * exp_sp *
RealVectorX _strain
strain data
virtual Real output_sensitivity_for_elem(const MAST::FunctionBase &p)
int get_subelem_side_on_level_set_boundary() const
Data(const RealVectorX &stress, const RealVectorX &strain, const libMesh::Point &qp, const libMesh::Point &xyz, Real JxW)
const MAST::VolumeBCMapType & volume_loads() const
MAST::NonlinearSystem & system()
virtual void evaluate_sensitivity(const MAST::FunctionBase &f)
this evaluates all relevant stress sensitivity components on the element to evaluate the p-averaged q...
std::map< const MAST::FunctionBase *, RealVectorX > _stress_sensitivity
map of sensitivity of the stress with respect to a parameter
std::multimap< libMesh::subdomain_id_type, MAST::BoundaryConditionBase * > VolumeBCMapType
libMesh::Point _qp
quadrature point location in element coordinates
RealMatrixX _dstress_dX
derivative of stress wrt state vector
virtual void functional_for_all_elems()
calculates and returns the von Mises p-norm functional for all the elements that this object currentl...
const RealVectorX & stress() const
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...
std::unique_ptr< MAST::StructuralElementBase > build_structural_element(MAST::SystemInitialization &sys, MAST::AssemblyBase &assembly, const MAST::GeomElem &elem, const MAST::ElementPropertyCardBase &p)
builds the structural element for the specified element type
unsigned int n_boundary_stress_strain_data_for_elem(const GeomElem &e) const
void clear()
clears the data structure of any stored values so that it can be used for another element...
virtual void functional_sensitivity_for_all_elems(const MAST::FunctionBase &f, Real &dsigma_vm_val_df) const
calculates and returns the sensitivity of von Mises p-norm functional for all the elements that this ...
std::map< const libMesh::dof_id_type, std::vector< MAST::StressStrainOutputBase::Data * > > _boundary_stress_data
vector of stress with the associated location details
RealVectorX & y_vector()
returns value of the property val.
const MAST::GeomElem & elem() const
Real von_Mises_stress() const
const RealMatrixX & get_dstrain_dX() const
This provides the base class for definitin of element level contribution of output quantity in an ana...
void clear_sensitivity_data()
void set_local_y_vector(const RealVectorX &y_vec)
for 1D elements the transformed coordinate system attached to the element defines the local x-axis al...
Real _sigma0
reference stress value used in scaling volume.
RealVectorX _stress
stress data
virtual void zero_for_sensitivity()
zeroes the output quantity values stored inside this object so that assembly process can begin...
virtual ~StressStrainOutputBase()
MAST::PhysicsDisciplineBase * _discipline
Real _rho
exponent used in scaling volume based on stress value.
const RealVectorX & get_strain_sensitivity(const MAST::FunctionBase &f) const
@ returns the sensitivity of the data with respect to a function
MAST::ElementBase * _physics_elem
virtual const std::vector< MAST::StressStrainOutputBase::Data * > & get_stress_strain_data_for_elem(const MAST::GeomElem &e) const
bool _primal_data_initialized
primal data, needed for sensitivity and adjoints
virtual void evaluate_topology_sensitivity(const MAST::FunctionBase &f, const MAST::FieldFunction< RealVectorX > &vel)
This evaluates the contribution to the topology sensitivity on the boundary.
Real _p_norm_stress
norm to be used for calculation of output stress function.
virtual const libMesh::Elem & get_reference_elem() const
const libMesh::Point & point_location_in_element_coordinate() const
virtual Real output_sensitivity_total(const MAST::FunctionBase &p)
Real dvon_Mises_stress_dp(const MAST::FunctionBase &f) const
unsigned int n_stress_strain_data_for_elem(const MAST::GeomElem &e) const
std::map< const libMesh::dof_id_type, std::vector< MAST::StressStrainOutputBase::Data * > > _stress_data
vector of stress with the associated location details
RealMatrixX _dstrain_dX
derivative of strain data wrt state vector
virtual const std::map< const libMesh::dof_id_type, std::vector< MAST::StressStrainOutputBase::Data * > > & get_stress_strain_data() const
Matrix< Real, Dynamic, Dynamic > RealMatrixX
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()...
Real get_maximum_von_mises_stress() const
bool if_elem_has_level_set_boundary() const
MAST::BoundaryConditionBase * get_thermal_load_for_elem(const MAST::GeomElem &elem)
virtual void functional_boundary_sensitivity_for_all_elems(const MAST::FunctionBase &f, Real &dsigma_vm_val_df) const
calculates and returns the sensitivity of von Mises p-norm functional for all the elements that this ...
This class inherits from MAST::GeomElem and provides an interface to initialize FE objects on sub-ele...
virtual void init(const MAST::GeomElem &elem)
initialize for the element.
virtual void set_elem_data(unsigned int dim, const libMesh::Elem &ref_elem, MAST::GeomElem &elem) const
sets the structural element y-vector if 1D element is used.
Matrix< Real, Dynamic, 1 > RealVectorX
Real quadrature_point_JxW() const
virtual void zero_for_analysis()
zeroes the output quantity values stored inside this object so that assembly process can begin...
const MAST::ElementPropertyCardBase & get_property_card(const libMesh::Elem &elem) const
get property card for the specified element
virtual void clear_sensitivity_data()
clears the data stored for sensitivity analysis.
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...
This class provides a mechanism to store stress/strain values, their derivatives and sensitivity valu...
const RealVectorX & strain() const
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
virtual void functional_boundary_sensitivity_for_elem(const MAST::FunctionBase &f, const libMesh::dof_id_type e_id, Real &dsigma_vm_val_df) const
calculates and returns the boundary sensitivity of von Mises p-norm functional for the element e...
MAST::AssemblyBase * _assembly
StressStrainOutputBase()
default constructor
Real _JxW
quadrature point JxW (product of transformation Jacobian and quadrature weight) for use in definition...
void set_derivatives(const RealMatrixX &dstress_dX, const RealMatrixX &dstrain_dX)
adds the derivative data
virtual const libMesh::Elem & get_quadrature_elem() const
const RealVectorX & get_stress_sensitivity(const MAST::FunctionBase &f) const
@ returns the sensitivity of the data with respect to a function
virtual void evaluate()
this evaluates all relevant stress components on the element to evaluate the p-averaged quantity...
std::map< const MAST::FunctionBase *, RealVectorX > _strain_sensitivity
map of sensitivity of the strain with respect to a parameter
virtual MAST::StressStrainOutputBase::Data & get_stress_strain_data_for_elem_at_qp(const MAST::GeomElem &e, const unsigned int qp)
virtual void clear_elem()
clears the element initialization
virtual void functional_sensitivity_for_elem(const MAST::FunctionBase &f, const libMesh::dof_id_type e_id, Real &dsigma_vm_val_df) const
calculates and returns the sensitivity of von Mises p-norm functional for the element e...
bool has_stress_sensitivity(const MAST::FunctionBase &f) const
@ returns true if sensitivity data is available for function f .
bool _if_stress_plot_mode
identifies the mode in which evaluation is peformed.
virtual MAST::StressStrainOutputBase::Data & add_stress_strain_at_qp_location(const MAST::GeomElem &e, const unsigned int qp, const libMesh::Point &quadrature_pt, const libMesh::Point &physical_pt, const RealVectorX &stress, const RealVectorX &strain, Real JxW)
add the stress tensor associated with the qp.
bool if_subelem_has_side_on_level_set_boundary() const
RealVectorX dvon_Mises_stress_dX() const
const RealMatrixX & get_dstress_dX() const
std::set< const libMesh::Elem * > _elem_subset
set of elements for which the data will be stored.
virtual bool is_topology_parameter() const
virtual Real output_total()
void set_sensitivity(const MAST::FunctionBase &f, const RealVectorX &dstress_df, const RealVectorX &dstrain_df)
sets the sensitivity of the data with respect to a function
virtual MAST::StressStrainOutputBase::Data & add_stress_strain_at_boundary_qp_location(const MAST::GeomElem &e, const unsigned int s, const unsigned int qp, const libMesh::Point &quadrature_pt, const libMesh::Point &physical_pt, const RealVectorX &stress, const RealVectorX &strain, Real JxW_Vn)
add the stress tensor associated with the qp on side s of element e.
MAST::SystemInitialization * _system