Skip to content

Reply To: How to create complex 2D geometry stucture


Good afternoon guys!
I’m working on a similar problem and would like to know if it is possible to edit the source code of the indicators. I’m currently trying to create a “Sierpinski carpet” made solely of cuboids, but I’m currently struggling on adding a second “IndicatorCuboid” on the Cylinder2d example. My code goes as:

// Parameters for the simulation setup
const int N = 10; // resolution of the model
const T Re = 20.; // Reynolds number
const T maxPhysT = 10; // max. simulation time in s, SI unit
const T L = 0.1/N; // latticeL
const T lengthX = 3;
const T lengthY = 3;
const T centerCylinderX = lengthX/3;
const T centerCylinderY = lengthY/3;
const T centerCylinderX2 = lengthX/6;
const T centerCylinderY2 = lengthY/6;
const T radiusCylinder = 0.05;
const T originMainX = lengthX/3;
const T originMainY = lengthY/3;
const T originMainX2 = lengthX/6;
const T originMainY2 = lengthY/6;

// Stores geometry information in form of material numbers
void prepareGeometry( UnitConverter<T, DESCRIPTOR> const& converter,
SuperGeometry2D<T>& superGeometry )

OstreamManager clout( std::cout,”prepareGeometry” );
clout << “Prepare Geometry …” << std::endl;

Vector<T,2> extend( lengthX,lengthY );
Vector<T,2> square( centerCylinderX,centerCylinderY );
Vector<T,2> square2( centerCylinderX2,centerCylinderY2 );
Vector<T,2> originS( originMainX,originMainY );
Vector<T,2> originS2( originMainX2,originMainY2 );
Vector<T,2> origin;
IndicatorCuboid2D<T> circle( square, originS );
IndicatorCuboid2D<T> circle2( square2, originS2 );

But this unfortunally is not being able to generate a second square.
Do you know how can I do it?