matcal.full_field.field_mappers
Functions
|
Stand alone function for performing meshless interpolation between two point clouds. |
Classes
|
A class for generating spatially dependent measurements between different sets of full-field data. |
|
Class that performs meshless mapping. |
- class matcal.full_field.field_mappers.MeshlessMapperGMLS(target_coords, source_coords, polynomial_order=1, epsilon_multiplier=2.75, number_of_batches=2)[source]
Class that performs meshless mapping.
- matcal.full_field.field_mappers.meshless_remapping(field_data, fields_to_map, target_points, polynomial_order=1, search_radius_multiplier=2.75, target_time=None, time_field=None)[source]
Stand alone function for performing meshless interpolation between two point clouds. This function uses generalized moving least squares(GMLS) to perform local interpolations. GMLS tools provided by pycompadre.
This function is intended for interpolation, but has limited ability to do extrapolation. If extrapolation is expected, use lower order(<=2) polynomials to reduce errant edge effects of higher order polynomials. For default values of the search_radius_multiplier and polynomial_order see
MeshlessMapperGMLS- Parameters:
field_data (
FieldData) – FieldData object that contains the data to be mapped to a new point cloud.fields_to_map (list(str)) – List of field names to be mapped from the provided field data to the target_points.
target_points (ArrayLike) – Two-dimensional array containing the points to be interpolated on. each column holding the coordinate, and each row representing a new point. Currently only tested for two-dimensional interpolation. Other dimensions may work as well, but should be used with caution.
polynomial_order (int) – The order of polynomial to use for interpolation/extrapolation.
search_radius_multiplier (float) – multiplier used to gather additional interpolation points once the minimum radius for a given polynomial order is reached. Higher values will include more points and in-general have a greater smoothing effect. Recommended values for this parameter are between 1.5 and 3.
- class matcal.full_field.field_mappers.FullFieldCalculator(reference_data, independent_field_vals, independent_field_name='time', position_names=['X', 'Y'], add_global_variables=True)[source]
A class for generating spatially dependent measurements between different sets of full-field data.
- Parameters:
reference_data – Passed as either a path to a full-field data file or a MatCal
FieldDataobject. This set the reference data file.independent_field_vals – An array of times or other time-like values to be used as the interpolation points in time for calculations.
independent_field_name – The name of a field to be used as the time interpolation axis. Any monotonic global field can be used. For example applied displacement can be used for uniaxial tension data. This field must exist on all data sets used.
position_names (list(str)) – A list of the different position names contained in any data sets used. The number of names passed will change the dimensionality of the problem. (Passing [‘x’, ‘y’] will create a 2D problem, while passing [‘x’, ‘y’, ‘z’] will create a 3D problem.) This value defaults to [‘X’, ‘Y’].
add_global_variables (bool) – copy global variables from all data sources to the new field data class.
- set_mapping_parameters(polynomial_order, search_radius_multiplier)[source]
Set the mapping parameters for the PyCompadre GMLS mapping algorithm. See
meshless_remapping()for more information on the mapping parameters.
- calculate_and_export(export_filename: str, file_type=None) None[source]
Perform calculations on the reference data, and the added data sets. Loops over all added data files and calculations, added with :add_data: and: add_spatial_calculation:, respectively. The results are exported to an external data file defined by the user.
Exported data includes all fields used in calculations. This data will appear as “<field_name>_ref” or “<field_name>_interp_<data_name>” with the former indicating values from the reference data and the later indicating the interpolated values from the additional data to the reference locations.
The calculated fields will be named “<function_name>_<data_name>”.
- Parameters:
export_filename (str) – filename to store the calculated data to.
file_type (str) – By default MatCal will select the exporter and file type for export based on the extension of export_filename. However, the file type can be manually specified here. The “json” file type is supported in MatCal core; however, other file types may be available in other modules.
- add_spatial_calculation(calculation_name: str, calculation_function: Callable, *field_names) None[source]
Add a new calculation to be preformed on the full-field data.
- Parameters:
calculation_name (str) – Name that will serve as the base for referencing the results of the caculations performed on the various full-field data sets. This name must be unique.
calculation_function (Callable) – Function used for performing calculations on the full-field data. Funcations expect a call signature of (reference_field[n_time, n_points], current_field[n_time, n_points], point_locations[n_points, n_dim], time[n_time]).
field_names (list(str)) – fields to pass into the calculation function. These field must exist on both the reference and additional data sets.
- add_data(data_name, field_data)[source]
Add full field data to be compared to the reference data field.
- Parameters:
data_name (str) – a name that will be used by reference this data set. This name must be unique.
field_data – passed as either a path to a full-field data file or a MatCal
FieldDataobject. This will add a new data set to used in the calculations.