Skip to content

Undefined reference to function during make

OpenLB – Open Source Lattice Boltzmann Code Forums on OpenLB General Topics Undefined reference to function during make

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #5686
    Kuanghua
    Participant

    Hello developers!
    I’m trying to use LBM to calcualte eletric field bby means of modifying the code in the examples cylinder2d.
    So I stille use the functions in the example cylinder2d to get Lattices’ Equilibrium and distribution function in my electric field construction program,however such functions’ parameter and definition should be changed to match electric field equation while the function’s name is always kept.
    The problem is, I define a new function sLattice.iniEquilibrium(bulkIndicator,rhoF)to calculate the iniEquilibrium(the original function sLattice.iniEquilibrium(bulkIndicator,rhoF,uF)is still kept)but this function cannot be defined during make, as the follow shows:

    undefined reference to `olb::Superlattice2D<double,olb::descriptors::D2Q9<>>::iniEquilibrium(olb::SuperIndicatorF2D<double>>&&,olb::AnalyticalF2D<double,double>&)’

    So what is the problem?Please give me some advice to solve this problem.
    If it needs to modify the makefile while I have done some modification on the header file and source file?
    Thanks in advance and best regards!

    #5688
    Adrian
    Keymaster

    Did you define the new iniEquilibrium method in the SuperLattice2D? (File: src/core/superLattice2D.h)

    By default there is only a iniEquilibrium function requiring both density and velocity fields.

    Defining just the density in an existing lattice is possible using e.g. SuperLattice2D::defineRho.

    #5690
    Kuanghua
    Participant

    Hello
    I have already defined the new iniEquilibrium in superLattice2D.h just after the original definition
    void iniEquilibrium(FunctorPtr<SuperIndicatorF2D<T>>&& indicator,
    AnalyticalF2D<T,T>& rho, AnalyticalF2D<T,T>& u); by
    void iniEquilibrium(FunctorPtr<SuperIndicatorF2D<T>>&& indicator, AnalyticalF2D<T, T>& rho);

    and yet the function cannot be identified.

    For me the iniEquilibrium should be calculated with density and weight coefficient.

    #5691
    Adrian
    Keymaster

    Ok, just to make sure: Did you also provide a matching implementation for this method signature declaration? It would help if you could share your code changes.

    You can also try doing your population value changes by directly accessing the lattive cells from your application code using e.g. SuperLattice2D::get(iC,iX,iY).

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