## Forum Replies Created

Viewing 3 posts - 1 through 3 (of 3 total)
• Author
Posts
• in reply to: How to create complex 2D geometry stucture #6209
jrfriggo
Participant

I am advancing with my research thanks to you and open LB, I’m so grateful!
However, right now I’m stuck with the Doxygen Documentation. The type of definition I used for the “IndicatorCuboid2D” is described in the line 78 of indicatorF2D.hh, using center, xlength, ylength and theta.
My doubt is: In this definition, there are only 2 lines of code and we only define the Maximum and the Minimum values for X and Y, uniting these points with straight lines to create a square. Is it possible for me to change these straight lines to curvy lines with a cossene function? Where should I include it in the code? I’ve tried some unsuccessful syntaxes, but couldn’t make it work in any way.
Here is the original code for the IndicatorCuboid2D:

78 IndicatorCuboid2D<S>::IndicatorCuboid2D(S xLength, S yLength, Vector<S,2> center, S theta )
79 : _center(center), _xLength(xLength), _yLength(yLength), _theta(-theta)
80 {
81 this->_myMin = {_center[0] – _xLength/2., _center[1] – _yLength/2.};
82 this->_myMax = {_center[0] + _xLength/2., _center[1] + _yLength/2.};
83 }

in reply to: How to create complex 2D geometry stucture #6170
jrfriggo
Participant

Thanks A LOT for your answer, it was a silly mistake on the material numbers, now it worked perfectly.
There’s now another doubt (You know, we solve a problem and then create another):
Is it possible for me to create indicator cuboids in a loop? Without having to name each one individually, just create lots of squares changing their coordinates and sizes through an algorithim?

Sorry for the silly question, I’m a new C++ user as well.
Also, is it possible for me to acess the indicator cuboid source code and change the definitions of the squares to make the lines not exactly straight but “senoid-like”?

Again, thanks A LOT!
Best regards!

in reply to: How to create complex 2D geometry stucture #6167
jrfriggo
Participant

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 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?

Viewing 3 posts - 1 through 3 (of 3 total)