extended cell stencil
mesh.cellCells() gives a cross-like 6 cell stencil for hex cells. I'm in need of a 27 cell stencil, or at least a wider stencil of computation surrounding a face. There are some classes in
that may help. I've been trying them out, and the faceToCellStencil (extended -//-) seems interesting, but for a simple 3D cavity case it builds up nothing: 0 sized label list.
Does anyone here have any experience with these parts of the code?
Well, to answer myself:
take a look at CPCCellToCellStencil: it constructs a point based neighbourhood of the cell, thus picking up the 27 cell stencil often used for linear regression in the gradient reconstruction of sharp fields on structured meshes.
The labelListList is filled with with per-cell constructed labels of the surrounding cells. The first label is the label of the cell in question, the rest are the labels of the surrounding cells.
I just recently took a gander at the extendedLeastSquares fvScheme. That uses a point-to-cells connectivity that would return the 27 cell stencil for a hex mesh you are looking for.
Lines 164 on in leastSquaresVectors.C performs a loop over all cells connected to all the points bounding a given cell.
I gave up on leastSquares when I read this:
check out the last comment in the discussion.
For my fields, leastSquares did not help at all, I'll try extended once more and see what happens.
I've tried the extendedLeastSquares with the minDet = 8 to get the most cells, and the gradient reconstruction is unstable (in a symmetric way with respect to the mesh alignment) for a sharp spherical field.
Kyle, do you have any docs on this class that you can share? I'm happy with my gradient computation right now, but I will maybe spend some time to assemble the 27 cell stencil, cell based symm tensor for the linear regression myself, if it turns out to be necessary at some point.
I didn't analyze the code of extendedLs in depth, but it seems that the tensor is assembled based on owner-neighbour relationship, which will introduce problems for reconstruction of linear gradient (if it is xtremely sharp) in the skew direction....
|All times are GMT -4. The time now is 01:28.|