NuTo
Numerics Tool
Functions | Variables
GmshWriter.cpp File Reference
#include "nuto/geometryConcrete/GmshWriter.h"
#include <fstream>

Functions

void Header (std::ostream &out, NuTo::GmshWriter::Options opt)
 
void Footer3D (std::ostream &out, NuTo::GmshWriter::Options opt)
 
void Footer2D (std::ostream &out, NuTo::GmshWriter::Options opt)
 
void Aggregates3D (std::ostream &out, const Eigen::MatrixX4d &a, double thickness)
 

Variables

const std::string sAggregate
 
const std::string sAggregateWithInterface
 
const std::string sBox3D
 
const std::string sCylinder
 
const std::string sBox2D
 
const std::string sAggregate2D
 
const std::string sAggregate2DWithInterface
 

Function Documentation

void Aggregates3D ( std::ostream &  out,
const Eigen::MatrixX4d &  a,
double  thickness 
)
void Footer2D ( std::ostream &  out,
NuTo::GmshWriter::Options  opt 
)
void Footer3D ( std::ostream &  out,
NuTo::GmshWriter::Options  opt 
)
void Header ( std::ostream &  out,
NuTo::GmshWriter::Options  opt 
)

Variable Documentation

const std::string sAggregate
const std::string sAggregate2D
Initial value:
= R"(
Function Aggregate2D
p1 = newp; Point(p1) = {xC, yC, 0, meshCircle};
p2 = newp; Point(p2) = {xC+R,yC, 0, meshCircle};
p3 = newp; Point(p3) = {xC-R,yC, 0, meshCircle};
c1 = newreg; Circle(c1) = {p2,p1,p3};
c2 = newreg; Circle(c2) = {p3,p1,p2};
l1 = newreg; Line Loop(l1) = {c1,c2};
s1 = newreg; Plane Surface(s1) = {l1};
theOuterInterface[i] = l1;
theAggregates[i] = s1;
Return
)"
const std::string sAggregate2DWithInterface
Initial value:
= R"(
Function Aggregate2D
p1 = newp; Point(p1) = {xC, yC, 0, meshCircle};
p2 = newp; Point(p2) = {xC+R,yC, 0, meshCircle};
p3 = newp; Point(p3) = {xC,yC+R, 0, meshCircle};
p4 = newp; Point(p4) = {xC-R,yC, 0, meshCircle};
p5 = newp; Point(p5) = {xC,yC-R, 0, meshCircle};
c1 = newreg; Circle(c1) = {p2,p1,p3};
c2 = newreg; Circle(c2) = {p3,p1,p4};
c3 = newreg; Circle(c3) = {p4,p1,p5};
c4 = newreg; Circle(c4) = {p5,p1,p2};
l1 = newreg; Line Loop(l1) = {c1,c2,c3,c4};
theInnerInterface = newreg; Plane Surface(theInnerInterface) = {l1};
theAggregates[i] = theInnerInterface;
Ex0[] = Extrude { Line {c1}; Layers {{1}, {h}}; Recombine;};
Ex1[] = Extrude { Line {c2}; Layers {{1}, {h}}; Recombine;};
Ex2[] = Extrude { Line {c3}; Layers {{1}, {h}}; Recombine;};
Ex3[] = Extrude { Line {c4}; Layers {{1}, {h}}; Recombine;};
theInterfaces[4*i + 0] = Ex0[1];
theInterfaces[4*i + 1] = Ex1[1];
theInterfaces[4*i + 2] = Ex2[1];
theInterfaces[4*i + 3] = Ex3[1];
theOuterInterface[i] = newsl;
Line Loop(theOuterInterface[i]) = {Ex0[0],Ex1[0],Ex2[0],Ex3[0]};
Return
)"
const std::string sAggregateWithInterface
const std::string sBox2D
Initial value:
= R"(
Function Box2D
// points:
p0 = newp; Point(p0) = {xS, yS, 0, meshSpecimen};
p1 = newp; Point(p1) = {xE, yS, 0, meshSpecimen};
p2 = newp; Point(p2) = {xE, yE, 0, meshSpecimen};
p3 = newp; Point(p3) = {xS, yE, 0, meshSpecimen};
// lines
l0 = newreg; Line(l0) = {p0, p1};
l1 = newreg; Line(l1) = {p1, p2};
l2 = newreg; Line(l2) = {p2, p3};
l3 = newreg; Line(l3) = {p3, p0};
theBox = newreg; Line Loop(theBox) = { l0, l1, l2, l3};
Return
)"
const std::string sBox3D
const std::string sCylinder
Initial value:
= R"(
Function Cylinder3D
// base cirle
p0 = newp; Point(p0) = {0, 0, 0, meshSpecimen};
p1 = newp; Point(p1) = {0, radius, 0, meshSpecimen};
p2 = newp; Point(p2) = {0, -radius, 0, meshSpecimen};
c0 = newl; Circle(c0) = {p1, p0, p2};
c1 = newl; Circle(c1) = {p2, p0, p1};
baseLoop = newll; Line Loop(baseLoop) = {c0, c1};
baseSurface = news; Plane Surface(baseSurface) = {baseLoop};
// top cirle
p3 = newp; Point(p3) = {0, 0, height, meshSpecimen};
p4 = newp; Point(p4) = {0, radius, height, meshSpecimen};
p5 = newp; Point(p5) = {0, -radius, height, meshSpecimen};
c2 = newl; Circle(c2) = {p4, p3, p5};
c3 = newl; Circle(c3) = {p5, p3, p4};
topLoop = newll; Line Loop(topLoop) = {c2, c3};
topSurface = news; Plane Surface(topSurface) = {topLoop};
// barrell surfaces
verticalOne = newl; Line(verticalOne) = {p2, p5};
verticalTwo = newl; Line(verticalTwo) = {p1, p4};
barrelLoopOne = newll; Line Loop(barrelLoopOne) = {c0, verticalOne, -c2, -verticalTwo};
barrelLoopTwo = newll; Line Loop(barrelLoopTwo) = {c1, verticalTwo, -c3, -verticalOne};
barrelSurfaceOne = news; Ruled Surface(barrelSurfaceOne) = {barrelLoopOne};
barrelSurfaceTwo = news; Ruled Surface(barrelSurfaceTwo) = {barrelLoopTwo};
// surface loop
theBox = newreg;
Surface Loop(theBox) = {barrelSurfaceOne, barrelSurfaceTwo, baseSurface, topSurface};
Return
)"