Skip to content
Snippets Groups Projects
Commit 1d18d3b6 authored by Jonathan Youett's avatar Jonathan Youett Committed by Sander, Oliver
Browse files

Add method to compute the stress

parent 8c84f971
No related branches found
No related tags found
1 merge request!11Add method to compute the local stress of a Cosserat rod
Pipeline #2299 failed
...@@ -117,6 +117,10 @@ public: ...@@ -117,6 +117,10 @@ public:
const Entity& element, const Entity& element,
const Dune::FieldVector<double,1>& pos) const; const Dune::FieldVector<double,1>& pos) const;
Dune::FieldVector<RT, 6> getStress(const std::vector<RigidBodyMotion<RT,3> >& localSolution,
const Entity& element,
const Dune::FieldVector<double,1>& pos) const;
protected: protected:
void getLocalReferenceConfiguration(const Entity& element, void getLocalReferenceConfiguration(const Entity& element,
...@@ -502,6 +506,28 @@ getStrain(const std::vector<RigidBodyMotion<RT,3> >& localSolution, ...@@ -502,6 +506,28 @@ getStrain(const std::vector<RigidBodyMotion<RT,3> >& localSolution,
return strain; return strain;
} }
template <class GridType, class RT>
Dune::FieldVector<RT, 6> RodLocalStiffness<GridType, RT>::
getStress(const std::vector<RigidBodyMotion<RT,3> >& localSolution,
const Entity& element,
const Dune::FieldVector<DT, 1>& pos) const
{
const auto& indexSet = gridView_.indexSet();
std::vector<TargetSpace> localRefConf = {referenceConfiguration_[indexSet.subIndex(element, 0, 1)],
referenceConfiguration_[indexSet.subIndex(element, 1, 1)]};
auto&& strain = getStrain(localSolution, element, pos);
auto&& referenceStrain = getStrain(localRefConf, element, pos);
Dune::FieldVector<RT, 6> stress;
for (int i=0; i < dim; i++)
stress[i] = (strain[i] - referenceStrain[i]) * A_[i];
for (int i=0; i < dim; i++)
stress[i+3] = (strain[i+3] - referenceStrain[i+3]) * K_[i];
return stress;
}
template <class GridType, class RT> template <class GridType, class RT>
void RodLocalStiffness<GridType, RT>:: void RodLocalStiffness<GridType, RT>::
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment