dune-composites (2.5.1)

plot_properties.hh
1#ifndef PLOT_STRESSES_HH
2#define PLOT_STRESSES_HH
3
4#include "composite_properties_lop.hh"
5
6namespace Dune{
7 namespace Composites{
8
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;
12
13 typedef Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::none,1> Scalar_VectorBackend;
14 typedef double RF;
15 std::string vtk_output = config.get<std::string>("ModelName","TestModel");
16 Dune::Timer timer;
17
18 using GV = Dune::PDELab::AllEntitySet<GV1>;
19 auto gv = GV(gv1);
20
21 // Initially we consider only a DG stress plot
22
23 //Function spaces for Stresses
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;
27
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");
31
32 typedef Dune::PDELab::istl::VectorBackend<Dune::PDELab::istl::Blocking::fixed,2> VectorBackend;
33
34 typedef Dune::PDELab::CompositeGridFunctionSpace <VectorBackend,Dune::PDELab::EntityBlockedOrderingTag,
35 SCALAR_P1GFS, SCALAR_P1GFS> P1GFS;
36
37 P1GFS p1gfs(materialType,orientation);
38
39 typedef Dune::PDELab::EmptyTransformation NoTrafo;
40
41 Dune::PDELab::composite_properties<GV,MODEL> lopProperties(gv,model);
42
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);
45
46 typedef typename GO::Traits::Range V1;
47 V1 properties(p1gfs,0.0), dummy(p1gfs,0.0);
48 go.residual(dummy,properties);
49
50 Dune::SubsamplingVTKWriter<GV1> vtkwriter(gv1,0);
51 Dune::PDELab::addSolutionToVTKWriter(vtkwriter,p1gfs,properties);
52 vtkwriter.write(model.vtk_properties_output,Dune::VTK::appendedraw);
53 }
54
55 }
56}
57
58#endif
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Sep 4, 22:38, 2025)