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

Compilation error with GeometricField copy constructor

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 25, 2019, 09:20
Question Compilation error with GeometricField copy constructor
  #1
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
Hi, I am trying to compile a very simple OF application as part of a learning exercise; however, I am seeing a compilation error that I don't understand, and I'm wondering if anyone can help?


This is the error I am getting:


Code:
Compiling enabled on 2 cores
g++ -std=c++11 -DlinuxARM7 -DWM_ARCH_OPTION=32 -DWM_DP -DWM_LABEL_SIZE=32 -Wall -Wextra -Wo
ld-style-cast -Wnon-virtual-dtor -Wno-unused-parameter -Wno-invalid-offsetof -Wno-attribute
s -O3 -floop-optimize -falign-loops -falign-labels -falign-functions -falign-jumps -fprefet
ch-loop-arrays -mcpu=cortex-a9 -mfpu=vfpv3-d16 -mfloat-abi=hard  -DNoRepository -ftemplate-
depth-100 -I/home/lee/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude -I/home/lee/OpenFOAM/O
penFOAM-6/src/OpenFOAM/fields/GeometricFields/GeometricField -I/home/lee/OpenFOAM/OpenFOAM-
6/src/OpenFOAM/fields/DimensionedFields/DimensionedField -IlnInclude -I. -I/home/lee/OpenFO
AM/OpenFOAM-6/src/OpenFOAM/lnInclude -I/home/lee/OpenFOAM/OpenFOAM-6/src/OSspecific/POSIX/l
nInclude   -fPIC -c gradient.C -o Make/linuxARM7GccDPInt32Opt/gradient.o
In file included from /home/lee/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude/fvMesh.H:58,
                 from /home/lee/OpenFOAM/OpenFOAM-6/src/finiteVolume/lnInclude/volMesh.H:42
,
                 from gradient.C:7:
/home/lee/OpenFOAM/OpenFOAM-6/src/OpenFOAM/fields/DimensionedFields/DimensionedField/Dimens
ionedField.H: In instantiation of ‘class Foam::DimensionedField<double, Foam::surfaceMesh>’
:
/home/lee/OpenFOAM/OpenFOAM-6/src/OpenFOAM/fields/GeometricFields/GeometricField/GeometricF
ield.H:81:7:   required from ‘class Foam::GeometricField<double, Foam::fvsPatchField, Foam:
:surfaceMesh>’
gradient.C:125:24:   required from here
/home/lee/OpenFOAM/OpenFOAM-6/src/OpenFOAM/fields/DimensionedFields/DimensionedField/Dimens
ionedField.H:83:40: error: invalid use of incomplete type ‘class Foam::surfaceMesh’
         typedef typename GeoMesh::Mesh Mesh;
                                        ^~~~
It only seems to happen when I add the following line of code to my .C file:


Code:
surfaceScalarField Tf("Tf",gf);
I am trying to use one of the GeometricField copy constructors to create Tf as a copy of gf (which is a pre-existing surfaceScalarField). gf is the interpolation weights for the interior mesh faces, and Tf is an interpolated scalar field that I want to calculate on the internal faces.


Am I using the copy constructor in this context incorrectly? Thanks in advance for any advice.
Time4Tea is offline   Reply With Quote

Old   May 26, 2019, 21:34
Default
  #2
Senior Member
 
Lee Strobel
Join Date: Jun 2016
Posts: 133
Rep Power: 9
Time4Tea is on a distinguished road
Aah ... I hadn't included "surfaceMesh.H". I really need to stop doing that ... :-(
Time4Tea is offline   Reply With Quote

Reply

Tags
openfoam/6


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
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries NickG OpenFOAM Installation 3 December 30, 2019 00:21
[OpenFOAM.org] Compile OF 2.3 on Mac OS X .... the patch gschaider OpenFOAM Installation 225 August 25, 2015 19:43
Compilation Error (V 1.7.1; Icc 12.1.0, OpenMPI 1.4.3) floydfan OpenFOAM Installation 7 December 20, 2011 05:56
OpenFoam-1.5 on Solaris -- compilation problem calling octreeDataPoint(.) constructor cincaipatron OpenFOAM Installation 9 January 11, 2010 06:37


All times are GMT -4. The time now is 20:41.