|
[Sponsors] |
fvMeshSubset and labelHashSet: mapping fields between the meshes |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
February 18, 2012, 12:40 |
fvMeshSubset and labelHashSet: mapping fields between the meshes
|
#1 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
Hi,
I am using a submesh within my solver. It is constructed out of selected cells from the 'normal' mesh by a labelHashSet cCells: Code:
labelHashSet cCells; forAll(mesh.C().internalField(), cellI) { if (mesh.C().internalField()[cellI].component(2) > -0.7) { cCells.insert(cellI); } } Code:
fvMeshSubset submesh(cSed, mesh); submesh.setLargeCellSubset(cCells, patchi, true); fvMesh& cMesh = submesh.subMesh(); Code:
forAll (cCells, celli) { cSed_C[celli] = cSed[cCells[celli]]; ... } Code:
forAll (cCells, celli) { cSed[cCells[celli]] = cSed_C[celli]; } So my questions are: 1. How can I map fields between meshes ('normal' mesh and submesh) from within my solver during runtime? I'm using OF 1.6-ext. 2. Does this have to be done like above or similar, or is this done automatically by OF, as the submesh is connected to the 'normal' mesh? 3. Is there a way to display the submesh in Paraview? The values are stored (together with the submesh points, faces etc.) in a subfolder of every time-step. These can of course be copied to a separate case, but is there an easier way? Arne |
|
February 19, 2012, 10:05 |
|
#2 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 18 |
After having a closer look at the fvMeshSubset source code I found that the mapping between the fields can be done using cellMap(), pointMap(), patchMap() or faceMap().
Where the mapping using the labelHashSet as described above does not work for any mapping direction, one simply creates e.g. a cellMap Code:
const labelList & cellMap_(submesh.cellMap()); Code:
forAll (cellMap_, celli) { alpha1_C[celli] = alpha1[cellMap_[celli]]; } forAll (cellMap_, celli) { alpha1[cellMap_[celli]] = alpha1_C[celli]; } Arne |
|
|
|