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

ERROR: attempt to access element from zero sized list

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   June 26, 2013, 08:03
Default ERROR: attempt to access element from zero sized list
  #1
New Member
 
suhas jain suresh
Join Date: Aug 2012
Location: Stanford, USA
Posts: 27
Rep Power: 13
suhas jain is on a distinguished road
Hi everyone,


"
// loop over faces
forAll(faces, facei)
{
label faceI = faces[facei];

//find patch
label patchI = psi.mesh().boundaryMesh().whichPatch(faceI);

// if facei is in patch: patchI < -1
if (patchI > -1)
{
if (!isA<emptyFvPatch>(psi.boundaryField()[patchI]))
{

faceI = psi.mesh().boundaryMesh()[patchI].whichFace(faceI);
psiBoundary = psi.boundaryField()[patchI][faceI];
}

Info << " Face: " << faceI << " Psi value: " << psiBoundary;
}
}

"



I am using the above code to access the value of psi (a distance function) at the boundaries. But during the execution of the "psiBoundary"( as seen above) I am getting this error



"

--> FOAM FATAL ERROR:
attempt to access element from zero sized list

From function UList<T>::checkIndex(const label)
in file /opt/openfoam220/src/OpenFOAM/lnInclude/UListI.H at line 103.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1 Foam::error::abort() in "/opt/openfoam220/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2
at /opt/openfoam220/src/OpenFOAM/lnInclude/errorManip.H:85
#3
at /opt/openfoam220/src/OpenFOAM/lnInclude/UListI.H:103
#4
at /opt/openfoam220/src/OpenFOAM/lnInclude/UListI.H:168
#5
at ~/OpenFOAM/suhas-2.2.0/applications/solvers/levelSetFoam/reinit.H:169
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7

"


I just know this is something related to the index " i " in the UListI.H but I couldn't figure out what exactly is going on there.

Any advice?

Thanks in advance,
Suhas
suhas jain is offline   Reply With Quote

 


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
[Other] Mesh Importing Problem cuteapathy ANSYS Meshing & Geometry 2 June 24, 2017 05:29
[swak4Foam] Error bulding swak4Foam sfigato OpenFOAM Community Contributions 18 August 22, 2013 12:41
[swak4Foam] build problem swak4Foam OF 2.2.0 mcathela OpenFOAM Community Contributions 14 April 23, 2013 13:59
mpirun and selfcoded fvPatchField: "attempt to access element from zero sized list" astein OpenFOAM Running, Solving & CFD 2 July 14, 2010 04:49
DecomposePar links against liblamso0 with OpenMPI jens_klostermann OpenFOAM Bugs 11 June 28, 2007 17:51


All times are GMT -4. The time now is 08:05.