BasicTools.Containers.ConstantRectilinearMeshTools module

BasicTools.Containers.ConstantRectilinearMeshTools.CheckIntegrity(GUI=False) str[source]

CheckIntegrity function. Tests

Parameters:

GUI (bool, optional) – if True, generate (in some case) an output on a new window, by default False

Returns:

ok if all ok

Return type:

str

BasicTools.Containers.ConstantRectilinearMeshTools.CheckIntegrity_GetElementTransferMatrix(dim: int)[source]

CheckIntegrity function

Parameters:

dim (int) – dimensionality of the mesh to test

BasicTools.Containers.ConstantRectilinearMeshTools.CheckIntegrity_GetNodeTransferMatrix(dim: int)[source]

CheckIntegrity function

Parameters:

dim (int) – dimensionality of the mesh to test

BasicTools.Containers.ConstantRectilinearMeshTools.CheckIntegrity_GetSubSuperMesh(dim)[source]

CheckIntegrity function

Parameters:

dim (int) – dimensionality of the mesh to test

BasicTools.Containers.ConstantRectilinearMeshTools.CreateMesh(dim: int)[source]

Helper class to create a ConstantRectilinearMesh of dimension dim and with only one element of size 1

BasicTools.Containers.ConstantRectilinearMeshTools.CreateSquare(dimensions: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = [2, 2], origin: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = [-1.0, -1.0], spacing: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes] = [1.0, 1.0]) ConstantRectilinearMesh[source]

Create ConstantRectilinearMesh using the dimension, origin and spacing. Extra data is added:

the bulk element with tag “2D” the border elements with tags “X0”, “X1”, “Y0”, “Y1”, the nodes of the corner with tags “x0y0”, “x1y0”, “x1y1”, “x0y1”

Parameters:
  • dimensions (ArrayLike, optional) – Number of node in each dimension, by default [2,2]

  • origin (ArrayLike, optional) – position of the first corner, by default [-1.0,-1.0]

  • spacing (ArrayLike, optional) – size of the elements, by default [1.,1.]

Returns:

the

Return type:

ConstantRectilinearMesh

BasicTools.Containers.ConstantRectilinearMeshTools.GetElementTransferMatrix(inputMesh: ConstantRectilinearMesh, destinationMesh: ConstantRectilinearMesh) coo_matrix[source]

return the transfer operator to transfer a field defined on the elements of the input mesh (inputMesh) to the output mesh.

Parameters:
Returns:

OP: The transfer operation (sparse matrix in coo) field in the new mesh = OP.dot(field defined in the input Mesh)

Return type:

np.ndarray

BasicTools.Containers.ConstantRectilinearMeshTools.GetNodeTransferMatrix(inputMesh: ConstantRectilinearMesh, destinationMesh: ConstantRectilinearMesh) coo_matrix[source]

return the transfer operator to transfer a field defined on the nodes of the input mesh (inputMesh) to the output mesh. Data is extrapolated outsize if a point of the destination mesh lies outside the input mesh

Parameters:
Returns:

OP: The transfer operation (sparse matrix in coo) field in the new mesh = OP.dot(field defined in the input Mesh)

Return type:

np.ndarray

BasicTools.Containers.ConstantRectilinearMeshTools.GetSubSuperMesh(inputmesh: ConstantRectilinearMesh, newDimensions: _SupportsArray[dtype[Any]] | _NestedSequence[_SupportsArray[dtype[Any]]] | bool | int | float | complex | str | bytes | _NestedSequence[bool | int | float | complex | str | bytes]) ConstantRectilinearMesh[source]

Generate a new ConstantRectilinearMesh with the same volume (origin and size ) but with different number of elements

Parameters:
  • inputmesh (ConstantRectilinearMesh) – the input mesh to recover the origin and size

  • newDimensions (ArrayLike) – the dimensions of the new mesh

Returns:

the new mesh

Return type:

ConstantRectilinearMesh