Extract Velocity Components
OpenLB – Open Source Lattice Boltzmann Code › Forums › on OpenLB › General Topics › Extract Velocity Components
- This topic has 3 replies, 3 voices, and was last updated 2 years, 1 month ago by FBukreev.
-
AuthorPosts
-
June 25, 2022 at 2:41 am #6678achodankarParticipant
Hello Developers,
I am trying to extract the velocity components in separate functors. I would appreciate your help in this case.Code tried is as follows:
FunctorPtr< olb::SuperF3D< T, T > > f(velocity);
SuperExtractComponentF3D< T, T > velocityx (f, 0 );Error:
cylinder3d.cpp: In function ‘void getResults(olb::SuperLattice<double, olb::descriptors::D3Q19<> >&, const olb::UnitConverter<double, olb::descriptors::D3Q19<> >&, int, olb::SuperGeometry<double, 3>&, olb::util::Timer<double>&, olb::STLreader<double>&, olb::IndicatorLayer3D<double>&)’:
cylinder3d.cpp:224:48: error: cannot bind rvalue reference of type ‘olb::FunctorPtr<olb::SuperF3D<double, double> >&&’ to lvalue of type ‘olb::FunctorPtr<olb::SuperF3D<double, double> >’
224 | SuperExtractComponentF3D< T, T > velocityx ( f, 0 );
| ^
In file included from ../../../src/functors/lattice/functors3D.hh:40,
from ../../../src/functors/functors3D.hh:31,
from ../../../src/olb3D.hh:6,
from cylinder3d.cpp:43:
../../../src/functors/lattice/superBaseF3D.hh:130:31: note: initializing argument 1 of ‘olb::SuperExtractComponentF3D<T, W>::SuperExtractComponentF3D(olb::FunctorPtr<olb::SuperF3D<T, BaseType> >&&, int) [with T = double; W = double]’
130 | FunctorPtr<SuperF3D<T,W>>&& f, int extractDim)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
make: *** [../../../default.mk:31: cylinder3d.o] Error 1I would really appreciate help in resolving this error.
Thank you.
Best regards,
Abhijeet C.
July 1, 2022 at 9:50 am #6683AdrianKeymasterFunctorPtr
is only a helper to accept the various ways of referencing functors in a single method overload. You should never need to construct it manually.What should work is:
olb::SuperF3D<T,T> f(velocity); SuperExtractComponentF3D<T, T> velocityx(f, 0);
July 12, 2022 at 4:37 pm #6720achodankarParticipantHello Adrian,
I get this error:
poiseuille3d.cpp:468:32: error: use of deleted function ‘olb::SuperF3D<double, double>::SuperF3D(const olb::SuperF3D<double, double>&)’
468 | olb::SuperF3D<T,T> f(velocity);
| ^
In file included from ../../../src/core/superLattice.hh:37,
from ../../../src/boundary/setLocalVelocityBoundary3D.h:34,
from ../../../src/boundary/boundary3D.h:36,
from ../../../src/olb3D.h:2,
from poiseuille3d.cpp:31:
../../../src/functors/lattice/superBaseF3D.h:56:7: note: ‘olb::SuperF3D<double, double>::SuperF3D(const olb::SuperF3D<double, double>&)’ is implicitly deleted because the default definition would be ill-formed:
56 | class SuperF3D : public GenericF<W,int> {
| ^~~~~~~~
../../../src/functors/lattice/superBaseF3D.h:56:7: error: use of deleted function ‘olb::GenericF<T, S>::GenericF(const olb::GenericF<T, S>&) [with T = double; S = int]’
In file included from ../../../src/functors/analytical/indicator/indicatorBaseF3D.h:31,
from ../../../src/functors/analytical/indicator/indicatorF3D.h:28,
from ../../../src/geometry/cuboid3D.h:37,
from ../../../src/geometry/cuboidGeometry3D.h:39,
from ../../../src/communication/superStructure.h:31,
from ../../../src/core/superData.h:37,
from ../../../src/core/core.h:28,
from ../../../src/core/core3D.h:28,
from ../../../src/olb3D.h:1,
from poiseuille3d.cpp:31:
../../../src/functors/genericF.h:61:3: note: declared here
61 | GenericF(const GenericF&) = delete;
| ^~~~~~~~
make: *** [../../../default.mk:31: poiseuille3d.o] Error 1Thank you.
Yours sincerely,
Abhijeet C
July 29, 2022 at 10:26 am #6742FBukreevKeymasterHello Abhejeet,
you can try to use the Extract functor directly on the SuperLatticePhysVelocity functor, without buildung a SuperF from it.
Greetings,
Fedor -
AuthorPosts
- You must be logged in to reply to this topic.