|
[Sponsors] |
November 17, 2010, 13:44 |
Fill a volScalarField
|
#1 |
Member
Diego Villa
Join Date: Mar 2010
Location: Genova Italy
Posts: 37
Rep Power: 16 |
Hi All,
I start to try to programming in OF only in the last month, so sorry if I ask some stupid things. I have created a volScalarField and with a boolList I want fill the value inside each cells. In particular if the bool is equal true, the cell value should be 1 otherwise should be 0. I post the volScalarField costructor: volScalarField alfa ( IOobject ( "alfa", fileName(), mesh_, IOobject::NO_READ, IOobject::NO_WRITE ), mesh_ ); and the costructor of the boolList: boolList zoneCell(mesh_.nCells(), false); const labelList& cellLabels = mesh_.cellZones()[cellZoneID_]; forAll(cellLabels, i) { zoneCell[cellLabels[i]] = true; } obviously mesh_ is a reference to the fvMesh. If someone can help me I'll be very great-full. Diego |
|
Tags |
boollabel, volscalarfield |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to create initiate a volScalarField p without reading from disk NO_READ does not seem to work | dbxmcf | OpenFOAM Running, Solving & CFD | 14 | March 25, 2022 06:08 |
if-loop, volScalarField comparison | volker | OpenFOAM | 7 | March 6, 2020 20:03 |
Problems with creating a volScalarField | georlade | OpenFOAM Programming & Development | 4 | December 4, 2016 12:31 |
Confused about how OF handles operation between volScalarField and dimensionedScalar | Edy | OpenFOAM | 3 | September 30, 2010 10:07 |
dimensioned volScalarField | lions85 | OpenFOAM | 1 | November 12, 2009 02:41 |