|
[Sponsors] |
Problems with the initialization of SlicedGeometricField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
October 18, 2019, 01:13 |
Problems with the initialization of SlicedGeometricField
|
#1 |
New Member
汤龙民
Join Date: Aug 2019
Posts: 4
Rep Power: 7 |
Hello foamers,
I am confused with the code of class SlicedGeometricField these days. The version of my OpenFOAM is 2.4.x. The confusing part is about the constructors: First constructor, the head of the function is : ************************************************** SlicedGeometricField ( const IOobject&, const Mesh&, const dimensionSet&, const Field<Type>& completeField, const bool preserveCouples=true ); ************************************************** * In this constructor, I try to post an instance of GeometricField for the parameter completeField, like this: ************************************************** *** slicedVolVectorField slicedU ( IOobject ( "slicedU", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh, dimVelocity, U ); ************************************************** ******** here, U is a GeometricField. But the code will cast U into a Field type. The information about the boundaryField stored in GeometricField U will lose. But in the constructor of SlicedGeometricField,a constructor of slicedBoundaryField is called, and the casted GeometricField(parameter completeField) is post to it: ************************************************** ******************* Foam::SlicedGeometricField<Type, PatchField, SlicedPatchField, GeoMesh>:: SlicedGeometricField ( const IOobject& io, const Mesh& mesh, const dimensionSet& ds, const Field<Type>& completeField, const bool preserveCouples ) : GeometricField<Type, PatchField, GeoMesh> ( io, mesh, ds, Field<Type>(), slicedBoundaryField(mesh, completeField, preserveCouples) ) ************************************************** ********************************** Then, in the code of slicedBoundaryField constructor, the casted GeometricField (parameter completeField) is used to set the boundaryField: ************************************************** *************** bf.set ( patchi, new SlicedPatchField<Type> ( mesh.boundary()[patchi], DimensionedField<Type, GeoMesh>::null(), completeField ) ); ************************************************** * When I run my code, I got the error: ************************************************** **** --> FOAM FATAL ERROR: start 93 out of range 0 ... 53 From function UList<T>::checkStart(const label) in file $HOME/OpenFOAM/OpenFOAM-2.4.x/src/OpenFOAM/lnInclude/UListI.H at line 77. FOAM aborting ************************************************** *************************** I think the cause of this error is OpenFOAM use the internal Field( parameter completeField) to initialize the boundaryField. Because the index of boundaryField always bigger than those of internalFiled, so an out of range error will be raised. Did my description be true? Or I used the SlicedGeometricField in a wrong way? Any opinion will be of great help. Sincerely, tanglongmin |
|
Tags |
constructor, slicedgeometricfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
FMG initialization query | Mohsin | FLUENT | 6 | November 2, 2016 03:02 |
Full Multigrid Initialization | Mr.Goodcat | FLUENT | 0 | March 17, 2016 07:43 |
Weird time step initialization behavior - Wave generation model | liadpaskin | CFX | 3 | July 11, 2015 07:21 |
CFX temperature initialization | jp_ | CFX | 3 | August 28, 2014 10:06 |
Needed Benchmark Problems for FSI | Mechstud | Main CFD Forum | 4 | July 26, 2011 13:13 |