Skip to content

Compilation errors – dkt2d, settlingCube3d

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Compilation errors – dkt2d, settlingCube3d

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #4915
    sthavishtha
    Participant

    Dear all

    I am using the latest version of olb-v1.3-1. Unfortunately, both the example codes – dkt2d and settlingCube3d throw the same compilation errors as shown below. I have also tried make cleanbuild, make clean and make, which still yield the same compilation errors.

    Compile dkt2d.cpp
    g++ -DOLB_PRECOMPILED -O3 -Wall -march=native -mtune=native         -std=c++14  -I/cluster/home/sbhopala/olb/src -I/cluster/home/sbhopala/olb/src/ -I/cluster/home/sbhopala/olb/src/external -I/cluster/home/sbhopala/olb/src/external/zlib -c dkt2d.cpp -o /cluster/scratch/sbhopala/run_ictslbm/dkt2d/dkt2d.o
    In file included from /cluster/home/sbhopala/olb/src/functors/lattice/functors2D.hh:31:0,
                     from /cluster/home/sbhopala/olb/src/functors/functors2D.hh:30,
                     from /cluster/home/sbhopala/olb/src/olb2D.hh:5,
                     from dkt2d.cpp:23:
    /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh: In instantiation of ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’:
    dkt2d.cpp:268:1:   required from here
    /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13: error: no matching function for call to ‘olb::Cell<double, olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR> >::setField(double [2])’
                 this->_blockLattice.get(iX, iY).template setField<descriptors::VELOCITY_NUMERATOR>(reset_to_zero);
                 ^
    In file included from /cluster/home/sbhopala/olb/src/core/blockLatticeStructure2D.h:31:0,
                     from /cluster/home/sbhopala/olb/src/boundary/boundaryCondition2D.h:31,
                     from /cluster/home/sbhopala/olb/src/boundary/boundary2D.h:28,
                     from /cluster/home/sbhopala/olb/src/olb2D.h:1,
                     from dkt2d.cpp:22:
    /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note: candidate: template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() > 1), void> olb::Cell<T, DESCRIPTOR>::setField(const olb::Vector<T, DESCRIPTOR:: size<FIELD>()>&) [with FIELD = FIELD; X = X; T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]
       setField(const Vector<T,DESCRIPTOR::template size<FIELD>()>& field)
       ^
    /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note:   template argument deduction/substitution failed:
    /cluster/home/sbhopala/olb/src/core/cell.h: In substitution of ‘template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() > 1), void> olb::Cell<T, DESCRIPTOR>::setField(const olb::Vector<T, DESCRIPTOR:: size<FIELD>()>&) [with FIELD = olb::descriptors::VELOCITY_NUMERATOR; X = <missing>]’:
    /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13:   required from ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’
    dkt2d.cpp:268:1:   required from here
    /cluster/home/sbhopala/olb/src/core/cell.h:153:3: error: expression ‘size<olb::descriptors::VELOCITY_NUMERATOR>’ is not a constant-expression
    /cluster/home/sbhopala/olb/src/core/cell.h:153:3: note: in template argument for type ‘unsigned int’ 
    /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh: In instantiation of ‘bool olb::BlockLatticePorousMomentumLossForce2D<T, DESCRIPTOR>::operator()(T*, const int*) [with T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]’:
    dkt2d.cpp:268:1:   required from here
    /cluster/home/sbhopala/olb/src/core/cell.h:164:3: note: candidate: template<class FIELD, class X> olb::utilities::meta::enable_if_t<(X:: size<FIELD>() == 1), void> olb::Cell<T, DESCRIPTOR>::setField(T) [with FIELD = FIELD; X = X; T = double; DESCRIPTOR = olb::descriptors::D2Q9<olb::descriptors::POROSITY, olb::descriptors::VELOCITY_NUMERATOR, olb::descriptors::VELOCITY_DENOMINATOR>]
       setField(T value)
       ^
    /cluster/home/sbhopala/olb/src/core/cell.h:164:3: note:   template argument deduction/substitution failed:
    In file included from /cluster/home/sbhopala/olb/src/functors/lattice/functors2D.hh:31:0,
                     from /cluster/home/sbhopala/olb/src/functors/functors2D.hh:30,
                     from /cluster/home/sbhopala/olb/src/olb2D.hh:5,
                     from dkt2d.cpp:23:
    /cluster/home/sbhopala/olb/src/functors/lattice/blockLatticeLocalF2D.hh:1050:13: note:   cannot convert ‘reset_to_zero’ (type ‘double [2]’) to type ‘double’
                 this->_blockLattice.get(iX, iY).template setField<descriptors::VELOCITY_NUMERATOR>(reset_to_zero);
                 ^
    make: *** [/cluster/scratch/sbhopala/run_ictslbm/dkt2d/dkt2d.o] Error 1

    I made appropriate changes in the ROOT and SRC of definitions.mk. However, I don’t believe this to be the source of mistake as the parallel and sequential versions of cavity2d work.

    Regards
    Sthavishtha

    #4925
    mathias
    Keymaster

    Please compile using the generic option in confik.mk according to:

    #BUILDTYPE := precompiled
    BUILDTYPE := generic

    Dont forget to “make cleanbuild”.

    Best
    mathias

    #4928
    sthavishtha
    Participant

    Dear Dr. Mathias

    I forgot to mention in my earlier post. I did try with a generic BUILDTYPE as well. Yet, I get the same error.

    Regards
    Sthavishtha

    #4929
    mathias
    Keymaster

    Ok, then resinstall everything without any changes and report if that clean version works in generic mode. It should work. From that clean starting point, apply step by step your wanted chanches and leave a meassage again in that forum if something doesnt work. Then, also state exactly which compiler you are using.

    #4930
    sthavishtha
    Participant

    Dear Dr. Mathias

    Thanks for the comments.

    The error arises due to the compiler version. I now use GCC 6.2.0 and it works. Using an old compiler version (GCC 5.2.0) earlier was enough to compile cavity2d, cylinder2d, cylinder3d problems. So, I was unable to identify the issue earlier with the examples available in the particles/ folder.

    Regards
    Sthavishtha

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