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

Custom BC compile warnings & Runtime Errors

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

Reply
 
LinkBack Thread Tools Display Modes
Old   September 28, 2011, 15:05
Default Custom BC compile warnings & Runtime Errors
  #1
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Dear Foamers,

I have modified some existing BCs (the timwVaryingMappedFixedValue and the tractionDisplacement). My goal is to make a timeVaryingMappedTractionDisplacement. I made what I believe to be the necessary modifications. I debugged apparent errors and it builds with warnings and an error . To me now, it is clear they are not just warnings they are errors because a sample problem crashes at initializing the variable for the BC, although it works fine for a displacement timwVaryingMappedFixedValue BC.

The warnings for the wmake:
Code:
hisham@numubuntu-System-Product-Name:~/OpenFOAM/numubuntu-2.0.0/trySolidDisplacementFoam$ wmake
Making dependency list for source file timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C
SOURCE=timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C ;  g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam200/src/finiteVolume/lnInclude -ItractionDisplacement/lnInclude -ItimeVaryingMappedTractionDisplacement/lnInclude -I/opt/openfoam200/src/triSurface/lnInclude -I/opt/openfoam200/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude   -fPIC -c $SOURCE -o Make/linux64GccDPOpt/timeVaryingMappedTractionDisplacementFvPatchVectorField.o
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H: In constructor ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::timeVaryingMappedTractionDisplacementFvPatchVectorField(const Foam::fvPatch&, const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&)’:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:110:21: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::pressure_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:65:14: warning:   ‘Foam::word Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::fieldTableName_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:45:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:95:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:92:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:45:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:105:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:103:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:45:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H: In constructor ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::timeVaryingMappedTractionDisplacementFvPatchVectorField(const Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField&, const Foam::fvPatch&, const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&, const Foam::fvPatchFieldMapper&)’:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:110:21: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::pressure_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:65:14: warning:   ‘Foam::word Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::fieldTableName_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:85:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:95:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:92:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:85:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:105:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:103:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:85:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H: In constructor ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::timeVaryingMappedTractionDisplacementFvPatchVectorField(const Foam::fvPatch&, const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&, const Foam::dictionary&)’:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:95:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:92:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:123:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:105:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:103:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:123:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H: In copy constructor ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::timeVaryingMappedTractionDisplacementFvPatchVectorField(const Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField&)’:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:110:21: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::pressure_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:65:14: warning:   ‘Foam::word Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::fieldTableName_’
Attached Files
File Type: gz CFD-online-28.9.2011ElSafti.tar.gz (68.3 KB, 4 views)

Last edited by Hisham; September 29, 2011 at 02:51.
Hisham is offline   Reply With Quote

Old   September 28, 2011, 15:06
Default
  #2
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Continue:

Code:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:171:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:95:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:92:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:171:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:105:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:103:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:171:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H: In constructor ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::timeVaryingMappedTractionDisplacementFvPatchVectorField(const Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField&, const Foam::DimensionedField<Foam::Vector<double>, Foam::volMesh>&)’:
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:110:21: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::pressure_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:65:14: warning:   ‘Foam::word Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::fieldTableName_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:206:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:95:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:92:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::startPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:206:1: warning:   when initialized here
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:105:16: warning: ‘Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endTractionAverage_’ will be initialized after
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.H:103:21: warning:   ‘Foam::scalarField Foam::timeVaryingMappedTractionDisplacementFvPatchVectorField::endPressureSampledValues_’
timeVaryingMappedTractionDisplacement/timeVaryingMappedTractionDisplacementFvPatchVectorField.C:206:1: warning:   when initialized here
g++ -m64 -Dlinux64 -DWM_DP -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor -O3  -DNoRepository -ftemplate-depth-100 -I/opt/openfoam200/src/finiteVolume/lnInclude -ItractionDisplacement/lnInclude -ItimeVaryingMappedTractionDisplacement/lnInclude -I/opt/openfoam200/src/triSurface/lnInclude -I/opt/openfoam200/src/meshTools/lnInclude -IlnInclude -I. -I/opt/openfoam200/src/OpenFOAM/lnInclude -I/opt/openfoam200/src/OSspecific/POSIX/lnInclude   -fPIC -Xlinker --add-needed Make/linux64GccDPOpt/tractionDisplacementFvPatchVectorField.o Make/linux64GccDPOpt/timeVaryingMappedTractionDisplacementFvPatchVectorField.o Make/linux64GccDPOpt/trySolidDisplacementFoam.o -L/opt/openfoam200/platforms/linux64GccDPOpt/lib \
	     -lfiniteVolume -lOpenFOAM -ldl   -lm -o /home/hisham/OpenFOAM/hisham-2.0.0/platforms/linux64GccDPOpt/bin/trySolidDisplacementFoam

The new BC is linked directly (statically) to the solver, just as the case with the solidDisplacementFoam solver and the tractionDisplacement BC. I, therefore, introduced a new solver called trySolidDisplacementFoam (no need to mess the original now, is there?)

I enclose the solver files and a tryPlateHole example. I hope that my error is easy to spot for someone (I am sure it is)!

Best regards,
Hisham

Last edited by Hisham; September 29, 2011 at 02:52.
Hisham is offline   Reply With Quote

Old   September 29, 2011, 06:51
Default
  #3
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
Dear Foamers,

I have modified it a bit. It compiles with warnings still. However, a run was successful. As I open paraFoam and choose to view the displacement "D", it crashes giving the following error:

Code:
hisham@numubuntu-System-Product-Name:~/solidDispFoamRun$ trySolidDisplacementFoam > log
hisham@numubuntu-System-Product-Name:~/solidDispFoamRun$ paraFoam &
[1] 3154
hisham@numubuntu-System-Product-Name:~/solidDispFoamRun$ 

--> FOAM FATAL IO ERROR: 

    Cannot find 'value' entry on patch CaissonLeft of field D in file "/home/hisham/solidDispFoamRun/0/D"
    which is required to set the values of the generic patch field.
    (Actual type timeVaryingMappedTractionDisplacement)

    Please add the 'value' entry to the write function of the user-defined boundary-condition


file: /home/hisham/solidDispFoamRun/0/D::boundaryField::CaissonLeft from line 47 to line 48.

    From function genericFvPatchField<Type>::genericFvPatchField(const fvPatch&, const Field<Type>&, const dictionary&)
    in file genericFvPatchField/genericFvPatchField.C at line 71.

FOAM exiting
I have tried the following line in the write function of the BC:
Code:
writeEntry("value", os);
I also tried:
Code:
this->writeEntry("value", os);
Both give the same error! Please help me find out the problem. I can upload the current version of code upon request.

Best regards,
Hisham
Hisham is offline   Reply With Quote

Old   September 29, 2011, 08:23
Default
  #4
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
I managed to solve the problems. It seems to work alright. Still needs more testing though. Anyone interested, please email me.

Thanks,
Hisham
Hisham is offline   Reply With Quote

Old   November 1, 2011, 22:10
Default
  #5
Member
 
Join Date: Sep 2011
Posts: 45
Rep Power: 5
ic3wall is on a distinguished road
I had the same problem, when it says:

"... will be initialized after "

Make sure you declare your variables in the same order in both the .C and .H files
ic3wall is offline   Reply With Quote

Old   November 2, 2011, 03:48
Default
  #6
Senior Member
 
Hisham's Avatar
 
Hisham El Safti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 247
Blog Entries: 10
Rep Power: 8
Hisham is on a distinguished road
I guess this is a C++ issue ...

Maybe a link like this will help:
http://objectmix.com/c/343613-warnin...zed-after.html

Regards,
Hisham
Hisham is offline   Reply With Quote

Reply

Tags
boundary condition, mapped, soliddisplacementfoam, timevarying

Thread Tools
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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write k and epsilon before the abnormal end xiuying OpenFOAM Running, Solving & CFD 8 August 27, 2013 15:33
Building OpenFOAM1.7.0 from source ata OpenFOAM Installation 42 May 14, 2012 20:48
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 bookie56 OpenFOAM Installation 8 August 13, 2011 04:03
IcoFoam parallel woes msrinath80 OpenFOAM Running, Solving & CFD 9 July 22, 2007 02:58
Could anybody help me see this error and give help liugx212 OpenFOAM Running, Solving & CFD 3 January 4, 2006 19:07


All times are GMT -4. The time now is 09:50.