1#ifndef PLOT_STRESSES_HH
2#define PLOT_STRESSES_HH
4#include "composite_properties_lop.hh"
9 template<
class MODEL,
typename V,
typename GV1,
typename GFS,
typename MBE>
10 void plotProperties(MODEL& model,
const GV1& gv1,
const GFS& gfs, MBE& mbe){
11 using Dune::PDELab::Backend::native;
13 typedef Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::none,1> Scalar_VectorBackend;
15 std::string vtk_output = config.get<std::string>(
"ModelName",
"TestModel");
18 using GV = Dune::PDELab::AllEntitySet<GV1>;
24 typedef typename GV::Grid::ctype e_ctype;
25 typedef Dune::PDELab::QkDGLocalFiniteElementMap<e_ctype,double,0,3> FEM_stress;
26 FEM_stress fem_stress;
28 typedef Dune::PDELab::GridFunctionSpace<GV, FEM_stress, Dune::PDELab::NoConstraints, Scalar_VectorBackend> SCALAR_P1GFS;
29 SCALAR_P1GFS materialType(gv,fem_stress); materialType.name(
"materialType");
30 SCALAR_P1GFS orientation(gv,fem_stress); orientation.name(
"orientation");
32 typedef Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed,2> VectorBackend;
34 typedef Dune::PDELab::CompositeGridFunctionSpace <VectorBackend,Dune::PDELab::EntityBlockedOrderingTag,
35 SCALAR_P1GFS, SCALAR_P1GFS> P1GFS;
37 P1GFS p1gfs(materialType,orientation);
39 typedef Dune::PDELab::EmptyTransformation NoTrafo;
41 Dune::PDELab::composite_properties<GV,MODEL> lopProperties(gv,model);
43 typedef Dune::PDELab::GridOperator<P1GFS,P1GFS,Dune::PDELab::composite_properties<GV,MODEL>,MBE,RF,RF,RF,NoTrafo,NoTrafo> GO;
44 GO go(p1gfs,p1gfs,lopProperties,mbe);
46 typedef typename GO::Traits::Range V1;
47 V1 properties(p1gfs,0.0), dummy(p1gfs,0.0);
48 go.residual(dummy,properties);
50 Dune::SubsamplingVTKWriter<GV1> vtkwriter(gv1,0);
51 Dune::PDELab::addSolutionToVTKWriter(vtkwriter,p1gfs,properties);
52 vtkwriter.write(model.vtk_properties_output,Dune::VTK::appendedraw);