Loading...
Searching...
No Matches
stress.cc

The stress tensor for the linear elasticity and Stokes problems.

The stress tensor for the linear elasticity and Stokes problems

#include "rheolef.h"
using namespace rheolef;
using namespace std;
int main(int argc, char** argv) {
environment rheolef (argc,argv);
Float inv_lambda;
field uh;
din >> catchmark("inv_lambda") >> inv_lambda
>> catchmark("u") >> uh;
const geo& omega = uh.get_geo();
const space& Xh = uh.get_space();
string grad_approx = "P" + to_string(Xh.degree()-1) + "d";
space Th (omega, grad_approx, "tensor");
size_t d = omega.dimension();
tensor I = tensor::eye (d);
field sigma_h;
if (inv_lambda == 0)
sigma_h = lazy_interpolate (Th, 2*D(uh));
else sigma_h = lazy_interpolate (Th, 2*D(uh) + (1/inv_lambda)*div(uh)*I);
dout << catchmark("s") << sigma_h;
}
Float
see the Float page for the full documentation
field
see the field page for the full documentation
geo
see the geo page for the full documentation
rheolef::catchmark
see the catchmark page for the full documentation
Definition catchmark.h:67
rheolef::environment
see the environment page for the full documentation
Definition environment.h:121
space
see the space page for the full documentation
tensor
see the tensor page for the full documentation
main
int main()
Definition field2bb.cc:58
rheolef
This file is part of Rheolef.
Definition compiler_eigen.h:39
std
STL namespace.
d
size_t d
Definition neumann-laplace-lambda.cc:28
rheolef.h
rheolef - reference manual