Skip to content

Geometry – Example “Cylinder2d”

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Geometry – Example “Cylinder2d”

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1831
    ivan
    Member

    Hello, everybodyrnrnI have been having a couple issues with the function rename.Geometry and thought you guys could maybe help me out with them. Basically what I am trying to do, concerning the example “”Cylinder2d””, is to set the inflow on the bottom and the outflow on the top, in order to simulate a vertical flow. Below, I am pasting my code and trying to explain what I tried to do with each of the commands.rnrn rnInitially, there would bernrn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rn0 0 0 0 0 0 0 0 0 0 0rnrnThe first command would change all the materials set as 0 to 2 rnsuperGeometry.rename(0,2);rnrn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rn2 2 2 2 2 2 2 2 2 2 2rnrnThe second command would change the materials set as 2 to 1, but only the ones in which you have a offset of 1 in directions x and y rnsuperGeometry.rename(2,1,1,1);rnrn2 2 2 2 2 2 2 2 2 2 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 2 2 2 2 2 2 2 2 2 2rnrnrnThe third command would change the materials set as 2 to 3, but only the ones in which there is no material 1 in the direction <0,-1>rnsuperGeometry.rename(2,3,1,0,-1);rnrn3 2 2 2 2 2 2 2 2 2 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 3 3 3 3 3 3 3 3 3 3rnrnThe fourth command would change all the materials set as 2 to 4rnsuperGeometry.rename(2,4);rnrn3 4 4 4 4 4 4 4 4 4 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 1 1 1 1 1 1 1 1 1 3rn3 3 3 3 3 3 3 3 3 3 3rnrnThe fifth command would change the materials set as 3 to 2, but only the ones in which there is no material 1 in the direction <0,1>rnsuperGeometry.rename(3,2,1,0,1);rnrn2 4 4 4 4 4 4 4 4 4 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 1 1 1 1 1 1 1 1 1 2rn2 3 3 3 3 3 3 3 3 3 2rnrnrnThe last command would change the materials inside the circle set as 1 to 5, which I did not represent herern superGeometry.rename(1,5,circle);rnrnrnThe error message is the following onernrn

    Quote:
    depalma@zenon:~/olb-1.0r0/examples/cylinder2dIvan$ makernCompile cylinder2d.cpprng++ -DOLB_PRECOMPILED -O3 -Wall -std=c++0x -I../../src -I../../src/ -I../../src/external -c cylinder2d.cpp -o /home/depalma/olb-1.0r0/examples/cylinder2dIvan/cylinder2d.orncylinder2d.cpp: In function u2018void prepareGeometry(const olb::LBconverter<double>&, olb::SuperGeometry2D<double>&)u2019:rncylinder2d.cpp:88:34: error: no matching function for call to u2018olb::SuperGeometry2D<double>::rename(int, int, int, int, int)u2019rn superGeometry.rename(2,3,1,0,-1);rn ^rncylinder2d.cpp:88:34: note: candidates are:rnIn file included from ../../src/boundary/superBoundaryCondition2D.h:38:0,rn from ../../src/boundary/boundary2D.h:38,rn from ../../src/olb2D.h:1,rn from cylinder2d.cpp:41:rn../../src/geometry/superGeometry2D.h:150:8: note: void olb::SuperGeometry2D<T>::rename(int, int) [with T = double]rn void rename(int fromM, int toM);rn ^rn../../src/geometry/superGeometry2D.h:150:8: note: candidate expects 2 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:152:8: note: void olb::SuperGeometry2D<T>::rename(int, int, olb::IndicatorF2D<S>&) [with T = double]rn void rename(int fromM, int toM, IndicatorF2D<T>& condition);rn ^rn../../src/geometry/superGeometry2D.h:152:8: note: candidate expects 3 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:154:8: note: void olb::SuperGeometry2D<T>::rename(int, int, unsigned int, unsigned int) [with T = double]rn void rename(int fromM, int toM, unsigned offsetX, unsigned offsetY);rn ^rn../../src/geometry/superGeometry2D.h:154:8: note: candidate expects 4 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:156:8: note: void olb::SuperGeometry2D<T>::rename(int, int, int, std::vector<int>) [with T = double]rn void rename(int fromM, int toM, int testM, std::vector<int> testDirection);rn ^rn../../src/geometry/superGeometry2D.h:156:8: note: candidate expects 4 arguments, 5 providedrnIn file included from ../../src/boundary/superBoundaryCondition2D.h:38:0,rn from ../../src/boundary/boundary2D.h:38,rn from ../../src/olb2D.h:1,rn from cylinder2d.cpp:41:rn../../src/geometry/superGeometry2D.h:158:8: note: void olb::SuperGeometry2D<T>::rename(int, int, int, olb::IndicatorF2D<S>&) [with T = double]rn void rename(int fromBcMat, int toBcMat, int fluidMat, IndicatorF2D<T>& condition);rn ^rn../../src/geometry/superGeometry2D.h:158:8: note: candidate expects 4 arguments, 5 providedrncylinder2d.cpp:90:33: error: no matching function for call to u2018olb::SuperGeometry2D<double>::rename(int, int, int, int, int)u2019rn superGeometry.rename(3,2,1,0,1);rn ^rncylinder2d.cpp:90:33: note: candidates are:rnIn file included from ../../src/boundary/superBoundaryCondition2D.h:38:0,rn from ../../src/boundary/boundary2D.h:38,rn from ../../src/olb2D.h:1,rn from cylinder2d.cpp:41:rn../../src/geometry/superGeometry2D.h:150:8: note: void olb::SuperGeometry2D<T>::rename(int, int) [with T = double]rn void rename(int fromM, int toM);rn ^rn../../src/geometry/superGeometry2D.h:150:8: note: candidate expects 2 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:152:8: note: void olb::SuperGeometry2D<T>::rename(int, int, olb::IndicatorF2D<S>&) [with T = double]rn void rename(int fromM, int toM, IndicatorF2D<T>& condition);rn ^rn../../src/geometry/superGeometry2D.h:152:8: note: candidate expects 3 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:154:8: note: void olb::SuperGeometry2D<T>::rename(int, int, unsigned int, unsigned int) [with T = double]rn void rename(int fromM, int toM, unsigned offsetX, unsigned offsetY);rn ^rn../../src/geometry/superGeometry2D.h:154:8: note: candidate expects 4 arguments, 5 providedrn../../src/geometry/superGeometry2D.h:156:8: note: void olb::SuperGeometry2D<T>::rename(int, int, int, std::vector<int>) [with T = double]rn void rename(int fromM, int toM, int testM, std::vector<int> testDirection);rn ^rn../../src/geometry/superGeometry2D.h:156:8: note: candidate expects 4 arguments, 5 providedrnIn file included from ../../src/boundary/superBoundaryCondition2D.h:38:0,rn from ../../src/boundary/boundary2D.h:38,rn from ../../src/olb2D.h:1,rn from cylinder2d.cpp:41:rn../../src/geometry/superGeometry2D.h:158:8: note: void olb::SuperGeometry2D<T>::rename(int, int, int, olb::IndicatorF2D<S>&) [with T = double]rn void rename(int fromBcMat, int toBcMat, int fluidMat, IndicatorF2D<T>& condition);rn ^rn../../src/geometry/superGeometry2D.h:158:8: note: candidate expects 4 arguments, 5 providedrnmake: *** [/home/depalma/olb-1.0r0/examples/cylinder2dIvan/cylinder2d.o] Error 1rndepalma@zenon:~/olb-1.0r0/examples/cylinder2dIvan$

    rnrnWhich basically says I am using “”rename(int,int,int,int,int)”” instead of “”rename(int, int, int, std::vector<int>)””. So, how should I use the std::vector<int> properly?rnrnrnBest regards, Ivan

    #2358
    robin.trunk
    Keymaster

    Hi Ivan,rnrndid it not work to build a std::vector and hand it to rename?rnstd::vector<int> dir ={ 0, -1 };rnsuperGeometry.rename(2,3,1,dir);rnrnBest regardsrnRobin

    #2359
    ivan
    Member

    Oh, it did! Thank you very much, Robin!

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.