Skip to content
Snippets Groups Projects
Commit 55bc0d05 authored by Sander, Oliver's avatar Sander, Oliver
Browse files

Merge branch 'local_rod_add_getstress' into 'master'

Add method to compute the local stress of a Cosserat rod

See merge request !11
parents 8c84f971 1d18d3b6
No related branches found
No related tags found
1 merge request!11Add method to compute the local stress of a Cosserat rod
Pipeline #2300 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