yt.utilities.lib.element_mappings module¶
This file contains coordinate mappings between physical coordinates and those defined on unit elements, as well as doing the corresponding intracell interpolation on finite element data.
- class yt.utilities.lib.element_mappings.ElementSampler¶
Bases:
object
This is a base class for sampling the value of a finite element solution at an arbitrary point inside a mesh element. In general, this will be done by transforming the requested physical coordinate into a mapped coordinate system, sampling the solution in mapped coordinates, and returning the result. This is not to be used directly; use one of the subclasses instead.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.NonlinearSolveSampler2D¶
Bases:
ElementSampler
This is a base class for handling element samplers that require a nonlinear solve to invert the mapping between coordinate systems. To do this, we perform Newton-Raphson iteration using a specified system of equations with an analytic Jacobian matrix. This solver is hard-coded for 2D for reasons of efficiency. This is not to be used directly, use one of the subclasses instead.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.NonlinearSolveSampler3D¶
Bases:
ElementSampler
This is a base class for handling element samplers that require a nonlinear solve to invert the mapping between coordinate systems. To do this, we perform Newton-Raphson iteration using a specified system of equations with an analytic Jacobian matrix. This solver is hard-coded for 3D for reasons of efficiency. This is not to be used directly, use one of the subclasses instead.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.P1Sampler1D¶
Bases:
ElementSampler
This implements sampling inside a linear, 1D element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.P1Sampler2D¶
Bases:
ElementSampler
This implements sampling inside a linear, triangular mesh element. This mapping is linear and can be inverted easily. Note that this implementation uses triangular (or barycentric) coordinates.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.P1Sampler3D¶
Bases:
ElementSampler
This implements sampling inside a linear, tetrahedral mesh element. This mapping is linear and can be inverted easily.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.Q1Sampler2D¶
Bases:
NonlinearSolveSampler2D
This implements sampling inside a 2D, linear, quadrilateral mesh element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.Q1Sampler3D¶
Bases:
NonlinearSolveSampler3D
This implements sampling inside a 3D, linear, hexahedral mesh element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.Q2Sampler2D¶
Bases:
NonlinearSolveSampler2D
This implements sampling inside a 2D, quadratic, quadrilateral mesh element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.S2Sampler3D¶
Bases:
NonlinearSolveSampler3D
This implements sampling inside a 3D, 20-node hexahedral mesh element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.T2Sampler2D¶
Bases:
NonlinearSolveSampler2D
This implements sampling inside a 2D, quadratic, triangular mesh element. Note that this implementation uses canonical coordinates.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.Tet2Sampler3D¶
Bases:
NonlinearSolveSampler3D
This implements sampling inside a 3D, quadratic, tetrahedral mesh element. Note that this implementation uses canonical coordinates.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- class yt.utilities.lib.element_mappings.W1Sampler3D¶
Bases:
NonlinearSolveSampler3D
This implements sampling inside a 3D, linear, wedge mesh element.
- check_contains(vertices, positions)¶
- map_reals_to_unit(vertices, positions)¶
- sample_at_real_points(vertices, field_values, positions)¶
- yt.utilities.lib.element_mappings.test_hex20_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_hex_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_linear1D_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_quad2_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_quad_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_tet2_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_tetra_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_tri2_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_tri_sampler(vertices, field_values, physical_x)¶
- yt.utilities.lib.element_mappings.test_wedge_sampler(vertices, field_values, physical_x)¶