|
[Sponsors] |
September 28, 2011, 16:05 |
Custom BC compile warnings & Runtime Errors
|
#1 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
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_’ Last edited by Hisham; September 29, 2011 at 03:51. |
|
September 28, 2011, 16:06 |
|
#2 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
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 03:52. |
|
September 29, 2011, 07:51 |
|
#3 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
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 Code:
writeEntry("value", os); Code:
this->writeEntry("value", os); Best regards, Hisham |
|
November 1, 2011, 22:10 |
|
#5 |
Member
Join Date: Sep 2011
Posts: 45
Rep Power: 15 |
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 |
|
November 2, 2011, 03:48 |
|
#6 |
Senior Member
Hisham Elsafti
Join Date: Apr 2011
Location: Braunschweig, Germany
Posts: 257
Blog Entries: 10
Rep Power: 17 |
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 |
|
Tags |
boundary condition, mapped, soliddisplacementfoam, timevarying |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Building OpenFOAM1.7.0 from source | ata | OpenFOAM Installation | 46 | March 6, 2022 14:21 |
How to write k and epsilon before the abnormal end | xiuying | OpenFOAM Running, Solving & CFD | 8 | August 27, 2013 16:33 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |
IcoFoam parallel woes | msrinath80 | OpenFOAM Running, Solving & CFD | 9 | July 22, 2007 03:58 |
Could anybody help me see this error and give help | liugx212 | OpenFOAM Running, Solving & CFD | 3 | January 4, 2006 19:07 |