pyoomph.meshes.meshdatacache module
- class pyoomph.meshes.meshdatacache.MeshDataCache(tesselate_tri=True, nondimensional=False, eigenvector=None, eigenmode='abs', history_index=0, with_halos=False, operator=None, discontinuous=False, add_eigen_to_mesh_positions=True, global_mesh=False)[source]
Bases:
objectHolds the extracted data of one option set (
MeshDataCacheKey), one entry per mesh.
- class pyoomph.meshes.meshdatacache.MeshDataCacheKey(nondimensional=False, tesselate_tri=True, eigenvector=None, eigenmode='abs', history_index=0, with_halos=False, operator=None, discontinuous=False, add_eigen_to_mesh_positions=True, global_mesh=False)[source]
Bases:
objectIdentifies one option set of extracted mesh data, i.e. one slot in the
MeshDataCacheStorage.Everything that changes the content of a
MeshDataCacheEntrymust be a field here - otherwise two different requests would share a cache slot and the second one would silently get the first one’s data. Do not access the fields positionally; that is what this class replaced.operatoris an arbitrary object and is hashed by identity, so two structurally identical operator instances still get separate cache slots.- classmethod create(eigenvector=None, **kwargs)[source]
Builds a key, normalizing the eigenvector selection. Sequences become a sorted tuple: they must be hashable to serve as a key, and [1,0] must land in the same slot as [0,1].
- Return type:
- property depends_on_eigen: bool
Whether the data behind this key changes when the eigenvectors change, i.e. whether
invalidate_cached_mesh_data(only_eigens=True)must flush it.
- class pyoomph.meshes.meshdatacache.MeshDataCacheOperatorBase[source]
Bases:
objectA generic operator that can be applied to a
MeshDataCacheEntrybefore it is e.g. written to a file. Specialized classes can e.g. merge an eigenfunction to the data or extrude the data azimuthally or along a Cartesian direction.
- class pyoomph.meshes.meshdatacache.MeshDataCartesianExtrusion(n_segments=32, default_length=1, phase=0.0, apply_k_mode_expansion=True, use_k_for_length=True, numperiods=1)[source]
Bases:
MeshDataCacheOperatorBaseCan be added as
operatortoMeshFileOutputto extrude the mesh in the z-direction. Most useful combined withMeshDataCombineWithEigenfunctionand Cartesian normal mode stability analysis.- Parameters:
n_segments (
int) – Number of segments in the z-direction.default_length – Default length of the extrusion (when no wave number is available).
phase (
float) – Axial offset the eigenmode expansion starts at. Until this was fixed it shifted only the elemental (D0/DL) fields, not the nodal ones.apply_k_mode_expansion (
bool) – If True, the extrusion will consider the exp(i*k*z) factor of the eigenfunction.use_k_for_length (
bool) – If True, the length of the extrusion will be determined by the wave number (if available, otherwise default_length).numperiods (
float) – Number of periods to extrude (in terms of either default_length or 2*pi/k).
- class pyoomph.meshes.meshdatacache.MeshDataCombineWithEigenfunction(eigenindex, eigen_prefix_real='EigenRe_', eigen_prefix_imag='EigenIm_', eigen_prefix_merged='Eigen_', add_eigen_to_mesh_positions=False)[source]
Bases:
MeshDataCacheOperatorBaseCan be added as
operatortoMeshFileOutputto combine the solution with the eigenfunction data. Both will be written to the same file and can be postprocessed in e.g. Paraview.- Parameters:
eigenindex (
int|Sequence[int]) – Index of the eigenfunction to combine with the solution. Can be a single index or a list of indices.eigen_prefix_real (
str) – Prefix for the real part of the eigenfunction data.eigen_prefix_imag (
str) – Prefix for the imaginary part of the eigenfunction data.eigen_prefix_merged (
str) – Prefix for the merged eigenfunction data.add_eigen_to_mesh_positions – If True, the eigenfunction data will be added to the mesh positions.
- class pyoomph.meshes.meshdatacache.MeshDataRotationalExtrusion(n_segments=32, angle=6.283185307179586, start_angle=0.0, rotate_eigendata_with_mode_m=True, collapse_axis_points=True)[source]
Bases:
MeshDataCacheOperatorBaseCan be added as
operatortoMeshFileOutputto extrude the mesh along the azimuthal phi-coordinate. Most useful combined withMeshDataCombineWithEigenfunctionand azimuthal normal mode stability analysis.- Parameters:
n_segments (
int) – Number of segments to extrude the mesh to.angle (
float) – Angle to extrude the mesh to. If larger than 2*pi, it will be cut off at 2*pi.start_angle (
float) – Angle to start the extrusion at.rotate_eigendata_with_mode_m (
bool) – If True, the eigendata will be rotated with the azimuthal mode number m. This is useful for azimuthal normal mode stability analysis.collapse_axis_points (
bool) – If True, a point element sitting on the symmetry axis stays a single vertex instead of being swept into a ring of zero-length line elements. Set it to False to reproduce the output of versions before this was fixed.