CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

undefined reference to `Foam::TurbulenceModel<Foam::geometricOneField, Foam::geometri

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 4, 2021, 22:34
Default undefined reference to `Foam::TurbulenceModel<Foam::geometricOneField, Foam::geometri
  #1
New Member
 
Join Date: May 2020
Posts: 8
Rep Power: 4
3014214149 is on a distinguished road
Hello, everyone.

I'm compiling a new solver in OpenFOAM 4.1. I met an error.

Code:
Make/linux64GccDPInt32Opt/simpleNNFoam.o: In function `Foam::TurbulenceModel<Foam::geometricOneField, Foam::geometricOneField, Foam::incompressibleTurbulenceModel, Foam::transportModel>::New(Foam::geometricOneField const&, Foam::geometricOneField const&, Foam::GeometricField<Foam::Vector<double>, Foam::fvPatchField, Foam::volMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::GeometricField<double, Foam::fvsPatchField, Foam::surfaceMesh> const&, Foam::transportModel const&, Foam::word const&)':
simpleNNFoam.C:(.text._ZN4Foam15TurbulenceModelINS_17geometricOneFieldES1_NS_29incompressibleTurbulenceModelENS_14transportModelEE3NewERKS1_S6_RKNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEERKNS7_IdNS_13fvsPatchFieldENS_11surfaceMeshEEESJ_RKS3_RKNS_4wordE[_ZN4Foam15TurbulenceModelINS_17geometricOneFieldES1_NS_29incompressibleTurbulenceModelENS_14transportModelEE3NewERKS1_S6_RKNS_14GeometricFieldINS_6VectorIdEENS_12fvPatchFieldENS_7volMeshEEERKNS7_IdNS_13fvsPatchFieldENS_11surfaceMeshEEESJ_RKS3_RKNS_4wordE]+0x35a): undefined reference to `Foam::TurbulenceModel<Foam::geometricOneField, Foam::geometricOneField, Foam::incompressibleTurbulenceModel, Foam::transportModel>::dictionaryConstructorTablePtr_'
collect2: error: ld returned 1 exit status
/home/cbq/OpenFOAM/OpenFOAM-4.1/wmake/makefiles/general:132: recipe for target '/home/cbq/OpenFOAM/cbq-4.1/platforms/linux64GccDPInt32Opt/bin/simpleNNFoam' failed
My option file is
Code:
EXE_INC = \
    -I/home/cbq/anaconda3/envs/mytorch/lib/python3.6/site-packages/torch/lib \
    -I/home/cbq/anaconda3/envs/mytorch/lib \
    -I$(LIB_SRC)/finiteVolume/lnInclude \
    -I$(LIB_SRC)/meshTools/lnInclude \
    -I$(LIB_SRC)/sampling/lnInclude \
    -I/home/cbq/run/test/transportModels \
    -I/home/cbq/run/test/transportModels/testincompressible/testsinglePhaseTransportModel \
    -I/home/cbq/run/test/TurbulenceModels/turbulenceModels/reynoldsNet/lnInclude \
    -I/home/cbq/run/test/TurbulenceModels/turbulenceModels/lnInclude \
    -I/home/cbq/run/test/TurbulenceModels/testincompressible/lnInclude \



EXE_LIBS = \
    -lprotobuf -lglog -lgflags -lpthread \
    -L/home/cbq/OpenFOAM/cbq-4.1/platforms/linux64GccDPInt32Opt/lib \
    -L/home/cbq/anaconda3/envs/mytorch/lib/python3.6/site-packages/torch/lib \
    -lc10 \
    -lcaffe2 \
    -L/home/cbq/anaconda3/envs/mytorch/lib \
    -lmkl_intel_lp64 \
    -lmkl_gnu_thread \
    -lmkl_core \
    -lmkl_rt \
    -lprotobuf \
    -lreynoldsnet \
    -ltestturbulenceModels \
    -ltestincompressibleTurbulenceModels \
    -ltestincompressibleTransportModels \
    -lfiniteVolume \
    -lmeshTools \
    -lfvOptions \
    -lsampling \
The libraries of turbulenceModels, incompressibleTurbulenceModels, incompressibleTransportModels are all modified. So I added "test" as prefix. But I didn't change namespace. For example, the testincompressibleTurbulenceModel.C is
Code:
/*---------------------------------------------------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     |
    \\  /    A nd           | Copyright (C) 2013-2014 OpenFOAM Foundation
     \\/     M anipulation  |
-------------------------------------------------------------------------------
License
    This file is part of OpenFOAM.

    OpenFOAM is free software: you can redistribute it and/or modify it
    under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    for more details.

    You should have received a copy of the GNU General Public License
    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.

\*---------------------------------------------------------------------------*/

#include "testincompressibleTurbulenceModel.H"

// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

namespace Foam
{
    defineTypeNameAndDebug(incompressibleTurbulenceModel, 0);
}


// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //

Foam::incompressibleTurbulenceModel::incompressibleTurbulenceModel
(
    const geometricOneField&,
    const volVectorField& U,
    const surfaceScalarField& alphaRhoPhi,
    const surfaceScalarField& phi,
    const word& propertiesName
)
:
    turbulenceModel
    (
        U,
        alphaRhoPhi,
        phi,
        propertiesName
    )
{}


Foam::tmp<Foam::volScalarField>
Foam::incompressibleTurbulenceModel::mu() const
{
    return nu();
}


Foam::tmp<Foam::scalarField>
Foam::incompressibleTurbulenceModel::mu(const label patchi) const
{
    return nu(patchi);
}


Foam::tmp<Foam::volScalarField>
Foam::incompressibleTurbulenceModel::mut() const
{
    return nut();
}


Foam::tmp<Foam::scalarField>
Foam::incompressibleTurbulenceModel::mut(const label patchi) const
{
    return nut(patchi);
}


Foam::tmp<Foam::volScalarField>
Foam::incompressibleTurbulenceModel::muEff() const
{
    return nuEff();
}


Foam::tmp<Foam::scalarField>
Foam::incompressibleTurbulenceModel::muEff(const label patchi) const
{
    return nuEff(patchi);
}


// ************************************************************************* //
Could anyone help me?
3014214149 is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Libraries to OpenFOAM MCrossover97 OpenFOAM Programming & Development 9 October 26, 2021 07:37
can not complie fluentDataToFoam in OF2.1.1 hewei OpenFOAM Pre-Processing 20 September 8, 2018 10:19
LiencubiclowRemodel nzy102 OpenFOAM Bugs 14 January 10, 2012 09:53
compile error about FJMPI chiven OpenFOAM Installation 11 March 31, 2010 07:27
OpenFOAM on MinGW crosscompiler hosted on Linux allenzhao OpenFOAM Installation 127 January 30, 2009 20:08


All times are GMT -4. The time now is 05:35.