|
[Sponsors] |
August 14, 2020, 10:20 |
reconCentral not compiled
|
#1 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Hello foamers,
I am trying to implement reconCentral scheme from Fe4.0 to OF1812. However i got the compiling error as 'does not match any in class': wmake libso (reconCentral) wmakeLnInclude: linking include files to ./lnInclude Making dependency list for source file reconCentral.C g++ -std=c++11 -m64 -DOPENFOAM=1812 -Dlinux64 -DWM_ARCH_OPTION=64 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wold-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attributes -Wno-unknown-pragmas -O3 -DNoRepository -ftemplate-depth-100 -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/finiteVolume/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/meshTools/lnInclude -IlnInclude -I. -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OpenFOAM/lnInclude -I/opt/apps/OpenFOAM/OpenFOAM-v1812/src/OSspecific/POSIX/lnInclude -fPIC -c reconCentral.C -o Make/linux64GccDPInt32Opt/reconCentral.o reconCentral.C:37:1: error: prototype for âFoam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&, const SFType&) constâ does not match any in class âFoam::reconCentral<Type>â Foam::reconCentral<Type>::interpolate ^ In file included from reconCentral.C:25:0: reconCentral.H:142:2: error: candidate is: virtual Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate(const Foam::GeometricField<Type, Foam::fvPatchField, Foam::volMesh>&) const interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const; ^ make: *** [Make/linux64GccDPInt32Opt/reconCentral.o] Error 1 I made some obvious modificiations. I share the last version of reconCentral file as attached. Thanks for every answers. |
|
August 14, 2020, 11:36 |
|
#2 |
Senior Member
Chris DeGroot
Join Date: Nov 2011
Location: Canada
Posts: 414
Rep Power: 18 |
The function signatures in your .H and .C files do not match.
In reconCentral.H: Code:
virtual tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate(const GeometricField<Type, fvPatchField, volMesh>&) const; Code:
Foam::reconCentral<Type>::interpolate ( const GeometricField<Type, fvPatchField, volMesh>& vf, //const GeometricField<Type, fvPatchField, volMesh>& sf const SFType& sf ) const |
|
August 16, 2020, 12:48 |
|
#3 | |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
Quote:
Last edited by hbulus; August 17, 2020 at 02:42. |
||
November 25, 2020, 02:47 |
|
#4 |
Member
Join Date: Dec 2018
Posts: 75
Rep Power: 7 |
EDIT = Thanks to the friends in this forum, i could modify the reconCentral scheme for OF1812 by their helps. I am sharing the final form of the codes.
This scheme should be used for unstructured meshes with high skewness, especially for tetrahedral cells reconCentral.C /*---------------------------------------------------------------------------*\ ========= | \\ / F ield | foam-extend: Open Source CFD \\ / O peration | Version: 4.0 \\ / A nd | Web: http://www.foam-extend.org \\/ M anipulation | For copyright notice see file Copyright ------------------------------------------------------------------------------- License This file is part of foam-extend. foam-extend 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. foam-extend 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 foam-extend. If not, see <http://www.gnu.org/licenses/>. \*---------------------------------------------------------------------------*/ #include "reconCentral.H" #include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::interpolate ( const GeometricField<Type, fvPatchField, volMesh>& vf ) const { const fvMesh& mesh = this->mesh(); tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsf ( new GeometricField<Type, fvsPatchField, surfaceMesh> ( IOobject ( "interpolate("+vf.name()+')', vf.instance(), vf.db() ), mesh, dimensioned<Type>(vf.name(), vf.dimensions(), pTraits<Type>::zero) ) ); GeometricField<Type, fvsPatchField, surfaceMesh>& sf = tsf.ref(); const labelList& owner = mesh.owner(); const labelList& neighbour = mesh.neighbour(); const volVectorField& C = mesh.C(); const surfaceVectorField& Cf = mesh.Cf(); tmp < GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh > > tgradVf = gradScheme_().grad(vf); const GeometricField < typename outerProduct<vector, Type>::type, fvPatchField, volMesh >& gradVf = tgradVf(); // Since grad is used on coupled boundaries, correctBoundaryConditions // needs to be called. HJ, 1/Nov/2012 //gradVf.correctBoundaryConditions(); forAll(sf.internalField(), facei) { // Owner contribution label own = owner[facei]; sf[facei] += 0.5*(vf[own] + ((Cf[facei] - C[own]) & gradVf[own])); // Neighbour contribution label nei = neighbour[facei]; sf[facei] += 0.5*(vf[nei] + ((Cf[facei] - C[nei]) & gradVf[nei])); } typename GeometricField<Type, fvsPatchField, surfaceMesh>:: Boundary& bSf = sf.boundaryFieldRef(); forAll(bSf, patchi) { const fvPatch& p = mesh.boundary()[patchi]; fvsPatchField<Type>& pSf = bSf[patchi]; const labelUList& pOwner = p.faceCells(); const vectorField& pCf = Cf.boundaryField()[patchi]; if (pSf.coupled()) { Field<Type> vfNei = vf.boundaryField()[patchi].patchNeighbourField(); Field<typename outerProduct<vector, Type>::type> pGradVfNei = gradVf.boundaryField()[patchi].patchNeighbourField(); // Build the d-vectors. Used to calculate neighbour face centre // HJ, 19/Apr/2010 // Better version of d-vectors: Zeljko Tukovic, 25/Apr/2010 vectorField pd = p.delta(); forAll(pOwner, facei) { label own = pOwner[facei]; // Owner contribution pSf[facei] += 0.5*(vf[own] + ((pCf[facei] - C[own]) & gradVf[own])); // Neighbour contribution pSf[facei] += 0.5* ( vfNei[facei] + ( (pCf[facei] - pd[facei] - C[own]) & pGradVfNei[facei] ) ); } } else if (vf.boundaryField()[patchi].fixesValue()) { // For fixed boundary patches copy the value pSf = vf.boundaryField()[patchi]; } else { // For patches that do not fix the value, calculate // extrapolated field forAll(pOwner, facei) { label own = pOwner[facei]; pSf[facei] = (vf[own] + ((pCf[facei] - C[own]) & gradVf[own])); } } } return tsf; } template<class Type> Foam::tmp<Foam::GeometricField<Type, Foam::fvsPatchField, Foam::surfaceMesh> > Foam::reconCentral<Type>::correction ( const GeometricField<Type, fvPatchField, volMesh>& vf ) const { // Note: Correction is calculated by assembling the complete interpolation // including extrapolated gradient contribution and subtracting the // implicit contribution. HJ, 27/Mar/2010 const fvMesh& mesh = this->mesh(); tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > tsfCorr ( new GeometricField<Type, fvsPatchField, surfaceMesh> ( IOobject ( "reconCentralCorrection(" + vf.name() + ')', mesh.time().timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE, false ), reconCentral<Type>::interpolate(vf) - surfaceInterpolationScheme<Type>::interpolate ( vf, this->weights() ) ) ); return tsfCorr; } namespace Foam { //makelimitedSurfaceInterpolationScheme(reconCentral ) makelimitedSurfaceInterpolationTypeScheme(reconCen tral, scalar) makelimitedSurfaceInterpolationTypeScheme(reconCen tral, vector) } // ************************************************** *********************** // Last edited by hbulus; November 27, 2020 at 07:34. |
|
December 2, 2020, 11:18 |
|
#5 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 367
Rep Power: 8 |
@hbulus
i am glad you finally solved your problem and thanks for sharing your adjustments to the code. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
OpenFoam in docker (gcc 6) vs. OpenFoam natively compiled (gcc 8.1.1) | Anouk | OpenFOAM Running, Solving & CFD | 0 | September 17, 2018 09:02 |
Compiled library vs. inInclude Files, DSMC solver crashes after run | GPesch | OpenFOAM Programming & Development | 8 | April 18, 2013 08:17 |
Using compiled UDF:s in different Fluent versions | S H | FLUENT | 1 | September 12, 2007 04:40 |
how to compile compiled UDF? | AVINASH | FLUENT | 3 | January 19, 2007 05:04 |
DEFINE_CG_MOTION Interpreted or Compiled? | Aussie Shane | FLUENT | 0 | April 20, 2006 05:50 |