BasicTools.Containers.UnstructuredMeshFieldOperations module

BasicTools.Containers.UnstructuredMeshFieldOperations.ApplyRotationMatrixTensorField(fields, fieldsToTreat, baseNames=['v1', 'v2'], inPlace=False, prefix='new_', inverse=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CellDataToPoint(mesh: UnstructuredMesh, cellfields: ndarray) ndarray[source]

Applies the CellDataToPointData from paraview. Supported only for the dimensionality of the mesh (no mix of elements of different dimensions)

Parameters:
  • mesh (UnstructuredMesh) – Mesh containing the cells and vertices concerned by the conversion.

  • cellfield (np.ndarray) – of size (number of fields, number of elements). Cell fields to convert to Point field.

Returns:

of size (number of points, number of fields). Field converted at the vertices of the mesh.

Return type:

np.ndarray

BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity1D(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity1DSecondOrderTo2D(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity1DTo2D(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity2D(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity2DTo3D(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrityApplyRotationMatrixTensorField(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity_CellDataToPoint(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity_GetValueAtPosLinearSymplecticMesh(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CheckIntegrity_PointToCellData(GUI=False)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.ComputeBarycentricCoordinateOnElement(coordAtDofs, localspace, targetPoint, elementType)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.ComputeInterpolationCoefficients(mask, TP, elementsdata, coordAtDofs, posspace, localspace)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.ComputeInterpolationExtrapolationsBarycentricCoordinates(TP, elementType, coordAtDofs, posspace)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.ComputeShapeFunctionsOnElement(coordAtDofs, localspace, localnumbering, point, faceElementType)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.CopyFieldsFromOriginalMeshToTargetMesh(inMesh: UnstructuredMesh, outMesh: UnstructuredMesh)[source]
Function to copy fields for the original mesh to the

derivated mesh ( f(inMesh) -> outMesh )

Parameters:
  • inMesh (UnstructuredMesh) – the source mesh, we extract the fields from inMesh.nodeFields and inMesh.elemFields.

  • outMesh (UnstructuredMesh) – The target mesh, we push the new fields into outMesh.nodeFields and outMesh.elemFields.

BasicTools.Containers.UnstructuredMeshFieldOperations.GetFieldTransferOp(inputField: FEField, targetPoints: Union[_SupportsArray[dtype], _NestedSequence[_SupportsArray[dtype]], bool, int, float, complex, str, bytes, _NestedSequence[Union[bool, int, float, complex, str, bytes]]], method: Optional[str] = None, verbose: bool = False, elementFilter: Optional[ElementFilter] = None) Tuple[ndarray, ndarray][source]

Compute the transfer operator from the inputField to the target points so: valueAtTargetPoints = op.dot(FEField.data)

possible methods are = [“Interp/Nearest”,”Nearest/Nearest”,”Interp/Clamp”,”Interp/Extrap”,”Interp/ZeroFill”] possible output status = {“Nearest”:0, “Interp”:1, “Extrap”:2, “Clamp”:3, “ZeroFill”:4 }

Parameters:
  • inputField (FEField) – the FEField to be transferred

  • targetPoints (ArrayLike) – Numpy array of the target points. Position to extract the values

  • method (Union[str,None], optional) –

    A couple for the algorithm used when the point is inside the mesh :

    ”Interp” -> to use the interpolation of the FEField to extract the values “Nearest” -> to use the closest point to extract the values

    Possible options are:

    ”Interp/Nearest”, “Nearest/Nearest”, “Interp/Clamp”, “Interp/Extrap”, “Interp/ZeroFill”

    If None is provided then “Interp/Clamp” is used

  • verbose (bool, optional) – Print a progress bar, by default False

  • elementFilter (Optional[ElementFilter], optional) – ElementFilter to extract the information from only a subdomain, by default None

Returns:

a tuple with 2 object containing:

op, sparse matrix with the operator to make the transfer status: vector of ints with the status transfer for each target point :

0: “Nearest” 1: “Interp” 2: “Extrap” 3: “Clamp” 4: “ZeroFill”

return op, status

Return type:

Tuple [np.ndarray,np.ndarray]

BasicTools.Containers.UnstructuredMeshFieldOperations.GetValueAtPosLinearSymplecticMesh(fields, mesh, constantRectilinearMesh, verbose=False)[source]

Works only for linear symplectic meshes

BasicTools.Containers.UnstructuredMeshFieldOperations.PointToCellData(mesh, pointfield, dim=None)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.QuadFieldToLinField(quadMesh, quadField, linMesh=None)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.RunTransfer(inputFEField, data, outmesh)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.TransportPos(imesh, tmesh, tspace, tnumbering, method='Interp/Clamp', verbose=None)[source]

Function to transport the position from the input mesh (imesh) to a target FEField target mesh, target space, tnumbering

BasicTools.Containers.UnstructuredMeshFieldOperations.TransportPosToPoints(imesh, points, method='Interp/Clamp', verbose=None)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.ddf(f, xiEtaPhi, dN, GetShapeFuncDerDer, coordAtDofs, linear)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.df(f, dN, coordAtDofs)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.hdinv(A)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.inv22(A)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.normsquared(v)[source]
BasicTools.Containers.UnstructuredMeshFieldOperations.vdet(A)[source]