mymesh.utils.ValueMapping#
- mymesh.utils.ValueMapping(NodeCoords1, SurfConn1, NodeVals1, NodeCoords2, SurfConn2, tol=inf, Octree='generate', MappingMatrix=None, verbose=False, return_MappingMatrix=False, return_octree=False, npts=inf)[source]#
Maps nodal values one surface to another. This currently only supports triangluar surface meshes TODO: Multi-value mapping may produce errors - need to better verify.
- Parameters:
NodeCoords1 (List of lists) – Contains coordinates for each node in surface 1. Ex. [[x1,y1,z1],…]
SurfConn1 (List of lists) – Contains the nodal connectivity defining the surface elements.
NodeVals1 (List or List of lists) – Scalar nodal values associated with surface 1. For multiple values: [[x1,x2,x3,…],[y1,y2,y3,…],[z1,z2,z3,…],…]
NodeCoords2 (List of lists) – Contains coordinates for each node in surface 2. Ex. [[x1,y1,z1],…].
SurfConn2 (List of lists) – Contains the nodal connectivity defining the surface elements.
tol (float, optional) – Tolerance value, if the projection distance is greater than tol, the projection will be exculded, default is np.inf
Octree (str (or octree.OctreeNode), optional) – octree options. An octree representation of surface 1 can significantly improve mapping speeds, by default ‘generate’. ‘generate’ - Will generate an octree for use in surface mapping. ‘none’ or None - Won’t generate an octree and will use a brute force approach. octree.OctreeNode - Provide a precompute octree structure corresponding to surface 1. Should be created by octree.Surface2Octree(NodeCoords1,SurfConn1)
MappingMatrix (list) – len(NodeCoords2)x4 matrix of of barycentric coordinates, defining NodeCoords2 in terms of the triangular surface elements of Surface 1.
verbose (bool, optional) – If true, will print mapping statistics, by default False.
return_MappingMatrix (bool, optional) – If true, will return MappingMatrix, by default False.
return_octree (bool, optional) – If true, will return generated or provided octree, by defualt False. NOTE if MappingMatrix is provided, the octree structure won’t be generated. In this cases, if Octree=’generate’ and return_octree=True, the returned value for octree will simply be the string ‘generate’.
npts (int, optional) – Number of points to map. Values from Surface 1 will be mapped to random sample of min(npts, len(NodeCoords2) in Surface 2, by default np.inf (all points).
- Returns:
NodeVals2 – Scalar nodal values associated with surface 2, mapped from surface 1.
- Return type:
List