Parsers¶
parsers
¶
CloudParser
¶
Object responsible for the parsing operation
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
path to the source file |
required |
Source code in src/interpcore/parsers.py
get_coordinates
¶
Extract coordinates from the loaded data based on the specified columns and number of components.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
col_mesh_x
|
int
|
index of the column containing x coordinates, by default 1 |
1
|
Returns:
| Type | Description |
|---|---|
ndarray
|
point coordinates array of source mesh points |
Source code in src/interpcore/parsers.py
get_values
¶
Extract values from the loaded data based on the specified column.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val_idx
|
int
|
index of the column containing the values |
required |
n_components
|
int
|
number of components to extract, by default 1 |
1
|
Returns:
| Type | Description |
|---|---|
ndarray
|
array of values from the specified columns |
Source code in src/interpcore/parsers.py
EMCloudParser
¶
Bases: CloudParser
Source code in src/interpcore/parsers.py
get_values
¶
Extract force values from the loaded data based on the specified columns for forces and volumes.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
val_idx
|
int
|
index of the column containing the force components |
required |
v_idx
|
int
|
index of the column containing volume information, by default None. If provided, the forces are interpreted as densities and scaled by the volume. |
None
|
Returns:
| Type | Description |
|---|---|
ndarray
|
array of force values, scaled by volume if v_idx is provided |
Source code in src/interpcore/parsers.py
parse_mech_mesh
¶
parse_mech_mesh(filepath: Path, col_mesh_ids: int = 0, col_mesh_x: int = 1, col_vol: int | None = None, col_area: int | None = None) -> dict[str, ndarray]
Parse a mechanical mesh and return the array of coordinates and the vector of node numbers
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
path to the mechanical mesh file |
required |
col_mesh_ids
|
int
|
index of the column containing node/element numbers, by default 0 |
0
|
col_mesh_x
|
int
|
index of the column containing x coordinates, by default 1 |
1
|
col_vol
|
int
|
index of the column containing volume information, by default None |
None
|
col_area
|
int
|
index of the column containing area information, by default None |
None
|
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
coordinates: np.ndarray point coordinates array of mechanical mesh nodes/element centroids id_numbers: np.ndarray array of mechanical mesh node/element numbers |
Source code in src/interpcore/parsers.py
parse_values
¶
parse_values(filepath: Path, load_type: INTERPOLATED_LOAD_TYPE, columns: ColumnsConfig, n_components: int) -> tuple[ndarray, ndarray]
Parse values to be interpolated
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filepath
|
Path
|
path to the source file |
required |
load_type
|
INTERPOLATED_LOAD_TYPE
|
type of load to be interpolated |
required |
columns
|
ColumnsConfig
|
column indices for parsing the source file |
required |
n_components
|
int
|
number of components to extract |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray, ndarray]
|
coordinates: np.ndarray point coordinates array of source mesh points values: np.ndarray array of values to interpolate |