self.patches is Null on main.py
Opened this issue · 0 comments
MSathler commented
Hello,
After installing everything and running dungeon_generator.py with 1 as n_envs I am trying to run the main.py code but I get this output:
Started env:rand_env_0
/home/itv/.local/lib/python3.8/site-packages/numpy/core/fromnumeric.py:2007: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
result = asarray(a).shape
/home/itv/.local/lib/python3.8/site-packages/numpy/lib/function_base.py:5030: VisibleDeprecationWarning: Creating an ndarray from ragged nested sequences (which is a list-or-tuple of lists-or-tuples-or ndarrays with different lengths or shapes) is deprecated. If you meant to do this, you must specify 'dtype=object' when creating the ndarray.
arr = asarray(arr)
--> FOAM FATAL ERROR:
while reading normal on line 2
expected <float> <float> <float> but found '-1,0000000e+000 0,0000000e+000 0,0000000e+000'
From function int STLLexer::lex()
in file triSurface/interfaces/STL/readSTLASCII.L at line 360.
FOAM exiting
rand_env_0 started meshing
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 7-3bcbaf946ae9
Exec : blockMesh
Date : Mar 15 2022
Time : 10:36:39
Host : "itv-Precision-Tower-5810"
PID : 5449
I/O : uncollated
Case : /home/itv/AutoGDM/environments/cfd/rand_env_0
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
--> FOAM Warning :
From function static bool Foam::functionObjectList::readFunctionObject(const Foam::string&, Foam::dictionary&, Foam::HashSet<>&, const Foam::word&)
in file db/functionObjects/functionObjectList/functionObjectList.C at line 278
Cannot find functionObject file sample
Creating block mesh from
"/home/itv/AutoGDM/environments/cfd/rand_env_0/system/blockMeshDict"
Creating block edges
No non-planar block faces defined
Creating topology blocks
Creating topology patches
Reading patches section
Creating block mesh topology
Reading physicalType from existing boundary file
Default patch type set to empty
Check topology
Basic statistics
Number of internal faces : 0
Number of boundary faces : 6
Number of defined boundary faces : 6
Number of undefined boundary faces : 0
Checking patch -> block consistency
Creating block offsets
Creating merge list .
Creating polyMesh from blockMesh
Creating patches
Creating cells
Creating points with scale 1
Block 0 cell size :
i : 0.2 .. 0.2
j : 0.2 .. 0.2
k : 0.2 .. 0.2
Writing polyMesh
----------------
Mesh Information
----------------
boundingBox: (0 0 0) (10 10 10)
nPoints: 132651
nCells: 125000
nFaces: 382500
nInternalFaces: 367500
----------------
Patches
----------------
patch 0 (start: 367500 size: 2500) name: maxY
patch 1 (start: 370000 size: 2500) name: minX
patch 2 (start: 372500 size: 2500) name: maxX
patch 3 (start: 375000 size: 2500) name: minY
patch 4 (start: 377500 size: 2500) name: minZ
patch 5 (start: 380000 size: 2500) name: maxZ
End
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 7
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 7-3bcbaf946ae9
Exec : surfaceFeatureExtract
Date : Mar 15 2022
Time : 10:36:40
Host : "itv-Precision-Tower-5810"
PID : 5450
I/O : uncollated
Case : /home/itv/AutoGDM/environments/cfd/rand_env_0
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time
--> FOAM Warning :
From function static bool Foam::functionObjectList::readFunctionObject(const Foam::string&, Foam::dictionary&, Foam::HashSet<>&, const Foam::word&)
in file db/functionObjects/functionObjectList/functionObjectList.C at line 278
Cannot find functionObject file sample
Reading surfaceFeatureExtractDict
Surface : "rand_env_0_flow_vol.stl"
Feature line extraction is only valid on closed manifold surfaces.
--> FOAM FATAL ERROR:
while reading normal on line 2
expected <float> <float> <float> but found '-1,0000000e+000 0,0000000e+000 0,0000000e+000'
From function int STLLexer::lex()
in file triSurface/interfaces/STL/readSTLASCII.L at line 360.
FOAM exiting
Traceback (most recent call last):
File "main.py", line 626, in <module>
env.pick_boundaries() # pick surfaces with largest vertical distance and largest size as inlet and outlet
File "main.py", line 428, in pick_boundaries
idxs = random.sample(range(0, len(patches) ), 2)
File "/usr/lib/python3.8/random.py", line 363, in sample
raise ValueError("Sample larger than population or is negative")
ValueError: Sample larger than population or is negative
I searched the code and saw that the variable self.patches has no values or [].
Can someone help me?
I'm running on ubuntu 20.04 and python3.8.10
Regards!