# - compIndicatorValue(pyTree) -
import Generator.PyTree as G
import Converter.PyTree as C
import Geom.PyTree as D
import Post.PyTree as P

s = D.circle((0, 0, 0), 1.)
snear = 0.1
o = G.octree([s], [snear], dfar=10., balancing=1)
res = G.octree2Struct(o, vmin=11, merged=1)
res = G.getVolumeMap(res)
o = P.computeIndicatorValue(o, res, 'centers:vol')
t = C.newPyTree(['Base'])
t[2][1][2] += [o]
C.convertPyTree2File(t, "out.cgns")
Ejemplo n.º 2
0
    Returns
    -------
    float

    """
    if 0.05 < abs(y) < 0.7:
        return K * math.exp(-K2 * (x - 0.5)**2)
    else:
        return 0.


res0 = C.initVars(res0, 'F', F, ['CoordinateX', 'CoordinateY'])

# Project the sensor field F on the unstructured octree:
o2 = P.computeIndicatorValue(o, res0, 'F')

# Computation of the indicator onto the unstructured octree mesh
npts = Internal.getZoneDim(o)[1]
o2, valInf, valSup = P.computeIndicatorField(o2,
                                             'F',
                                             nbTargetPts=1.1 * npts,
                                             refineFinestLevel=0,
                                             bodies=[naca])

# Adaptation of the octree wrt the indicator
o2 = G.adaptOctree(o2)

# Creation of the adapted structured Cartesian grids
res = G.octree2Struct(o2, vmin=5, ext=0)