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

Problems with the initialization of SlicedGeometricField

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 18, 2019, 01:13
Unhappy Problems with the initialization of SlicedGeometricField
  #1
New Member
 
汤龙民
Join Date: Aug 2019
Posts: 4
Rep Power: 6
tanglm is on a distinguished road
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
tanglm is offline   Reply With Quote

Reply

Tags
constructor, slicedgeometricfield

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 Off
Pingbacks are On
Refbacks are On


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


All times are GMT -4. The time now is 10:54.