5#ifndef MATLAB_ELASTICITY_HH_
6#define MATLAB_ELASTICITY_HH_
19 template<
class G,
class F>
31template<
class G,
class F>
32MatlabElasticityGraphics::MatlabElasticityGraphics(
34 const std::string& filename,
57 uint n = grad_u1->n();
68 for (uint i = 0; i < n; i++) {
69 strain11_(i) = grad_u1->operator ()(0, i);
70 strain22_(i) = grad_u2->operator ()(1, i);
72 * (grad_u2->operator ()(0, i) + grad_u1->operator ()(1, i));
75 for(uint i = 0; i < n; i++) {
76 stress11_(i) = 2*mu*(lambda/(lambda+2*mu) + 1) * strain11_(i)
77 + 2*mu*lambda/(lambda+2*mu) * strain22_(i);
78 stress22_(i) = 2*mu*lambda/(lambda+2*mu) * strain11_(i)
79 + 2*mu*(lambda/(lambda+2*mu) + 1) * strain22_(i);
80 stress12_(i) = 2 * mu * strain12_(i);
83 for (uint i = 0; i < n; i++) {
84 stress11_(i) = (lambda + 2 * mu) * strain11_(i) + lambda * strain22_(i);
85 stress22_(i) = lambda * strain11_(i) + (lambda + 2 * mu) * strain22_(i);
86 stress12_(i) = 2 * mu * strain12_(i);
87 stress33_(i) = lambda * (strain11_(i) + strain22_(i) );
93 for (uint i = 0; i < n; i++){
94 u1_(i) = u1->operator()(0,i);
95 u2_(i) = u2->operator()(0,i);
113 this->
add(stress11_,
"stress11");
114 this->
add(stress22_,
"stress22");
115 this->
add(stress12_,
"stress12");
117 this->
add(stress33_,
"stress33");
119 this->
add(u1_,
"displacement_u1");
120 this->
add(u2_,
"displacement_u2");
void add(const T &u, const std::string varName, enum matio_compression compress=MAT_COMPRESSION_NONE)
std::string filename() const
concepts::RCP< concepts::ElementMatrix< F > > getSolution(const concepts::Space< G > &spc, const concepts::Vector< F > &sol, const concepts::ElementFunction< F, G > *fun=0)
DenseMatrixCollection< G > getSpace(const concepts::Space< G > &spc)
void storeData_(DenseMatrixCollection< G > &dense_ptr_)
Stores data hold by dense_ptr.