Skip to content

Extract Velocity Components

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #6678
    achodankar
    Participant

    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 1

    I would really appreciate help in resolving this error.

    Thank you.

    Best regards,

    Abhijeet C.

    #6683
    Adrian
    Keymaster

    FunctorPtr 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);
    
    #6720
    achodankar
    Participant

    Hello 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 1

    Thank you.

    Yours sincerely,

    Abhijeet C

    #6742
    FBukreev
    Keymaster

    Hello Abhejeet,

    you can try to use the Extract functor directly on the SuperLatticePhysVelocity functor, without buildung a SuperF from it.

    Greetings,
    Fedor

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