Rheolef  7.2
an efficient C++ finite element environment
 
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;
}
see the Float page for the full documentation
see the field page for the full documentation
see the geo page for the full documentation
see the catchmark page for the full documentation
Definition catchmark.h:67
see the environment page for the full documentation
see the space page for the full documentation
see the tensor page for the full documentation
int main()
Definition field2bb.cc:58
This file is part of Rheolef.
STL namespace.
rheolef - reference manual