Files
mkdocs/doc/meshkernelpy/api/meshkernel.c_structures.md
T
2026-10-10 21:56:35 +08:00

810 lines
24 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# C 数据结构与转换接口
模块:`meshkernel.c_structures`。本页依据本地 MeshKernelPy `8.3.0` 源码生成,包含该模块定义的类、方法、函数和常量。签名及参数默认值以源码为准;原文未提供的说明会明确标记。
[返回 API 总览](modules.md)
## `CMesh2d` {#cmesh2d}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 Mesh2D 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`edge_faces`(`POINTER(c_int)`)**:每条边关联的网格面索引。
- **`edge_nodes`(`POINTER(c_int)`)**:组成每条二维网格边的节点。
- **`face_edges`(`POINTER(c_int)`)**:每个网格面的边索引。
- **`face_nodes`(`POINTER(c_int)`)**:组成每个二维网格面的节点。
- **`nodes_per_face`(`POINTER(c_int)`)**:组成每个二维网格面的节点。(原说明如此;实际字段表示每个面的节点数。)
- **`node_x`(`POINTER(c_double)`)**:节点的 x 坐标。
- **`node_y`(`POINTER(c_double)`)**:节点的 y 坐标。
- **`edge_x`(`POINTER(c_double)`)**:网格边中点的 x 坐标。
- **`edge_y`(`POINTER(c_double)`)**:网格边中点的 y 坐标。(原文误写为 x 坐标。)
- **`face_x`(`POINTER(c_double)`)**:网格面质心的 x 坐标。
- **`face_y`(`POINTER(c_double)`)**:网格面质心的 y 坐标。
- **`num_nodes`(`c_int`)**:网格节点数。
- **`num_valid_nodes`(`c_int`)**:有效一维节点数。
- **`num_edges`(`c_int`)**:边数。
- **`num_valid_edges`(`c_int`)**:有效边数。
- **`num_faces`(`c_int`)**:网格面数。
- **`num_face_nodes`(`c_int`)**:组成所有二维网格面的节点总数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `edge_faces` | `POINTER(c_int)` |
| `edge_nodes` | `POINTER(c_int)` |
| `face_edges` | `POINTER(c_int)` |
| `face_nodes` | `POINTER(c_int)` |
| `nodes_per_face` | `POINTER(c_int)` |
| `node_x` | `POINTER(c_double)` |
| `node_y` | `POINTER(c_double)` |
| `edge_x` | `POINTER(c_double)` |
| `edge_y` | `POINTER(c_double)` |
| `face_x` | `POINTER(c_double)` |
| `face_y` | `POINTER(c_double)` |
| `num_nodes` | `c_int` |
| `num_valid_nodes` | `c_int` |
| `num_edges` | `c_int` |
| `num_valid_edges` | `c_int` |
| `num_faces` | `c_int` |
| `num_face_nodes` | `c_int` |
**方法索引**
- [`from_mesh2d`](#cmesh2d-from-mesh2d)
- [`allocate_memory`](#cmesh2d-allocate-memory)
### `CMesh2d.from_mesh2d` {#cmesh2d-from-mesh2d}
```python
from_mesh2d(mesh2d: Mesh2d) -> CMesh2d
```
修饰器:`staticmethod`。
根据给定的 Mesh2d 实例创建新的 CMesh 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `mesh2d` | `Mesh2d` | `必填` | 持有状态的 NumPy 数组封装对象。 |
**返回值**
- **`CMesh2d`**:创建的 CMesh2d 实例。
### `CMesh2d.allocate_memory` {#cmesh2d-allocate-memory}
```python
allocate_memory(self) -> Mesh2d
```
根据名称以 `num_` 开头的参数分配数据内存。 随后将指针指向新分配的内存。 内存由此方法返回的 Mesh2d 实例持有。
**返回值**
- **`Mesh2d`**:持有已分配内存的对象。
## `CGeometryList` {#cgeometrylist}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 GeometryList 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`geometry_separator`(`c_double`)**:坐标数组中的几何分隔值。
- **`inner_outer_separator`(`c_double`)**:用于分隔多边形内边界和外边界的值。
- **`n_coordinates`(`c_int`)**:坐标值的数量。
- **`x_coordinates`(`POINTER(c_double)`)**:x 坐标。
- **`y_coordinates`(`POINTER(c_double)`)**:y 坐标。
- **`values`(`POINTER(c_double)`)**:二维网格上的数值。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `geometry_separator` | `c_double` |
| `inner_outer_separator` | `c_double` |
| `n_coordinates` | `c_int` |
| `x_coordinates` | `POINTER(c_double)` |
| `y_coordinates` | `POINTER(c_double)` |
| `values` | `POINTER(c_double)` |
**方法索引**
- [`from_geometrylist`](#cgeometrylist-from-geometrylist)
### `CGeometryList.from_geometrylist` {#cgeometrylist-from-geometrylist}
```python
from_geometrylist(geometry_list: GeometryList) -> CGeometryList
```
修饰器:`staticmethod`。
根据给定的 GeometryList 实例创建新的 `CGeometryList` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `geometry_list` | `GeometryList` | `必填` | 几何列表。 |
**返回值**
- **`CGeometryList`**:为给定 GeometryList 创建的 C 数据结构。
## `CInterpolationParameters` {#cinterpolationparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示采样数据插值所用的参数。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`interpolation_type`(`c_int`)**:默认使用采样数据平均插值。
- **`method`(`c_int`)**:使用的平均方法。
- **`absolute_search_radius`(`c_double`)**:绝对搜索半径。
- **`relative_search_radius`(`c_double`)**:相对搜索半径。
- **`use_closest_if_none_found`(`c_bool`)**:如果多边形内未找到采样点,则使用最近的点。
- **`minimum_number_of_samples`(`c_int`)**:某些平均方法所需的最少采样点数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `interpolation_type` | `c_int` |
| `method` | `c_int` |
| `absolute_search_radius` | `c_double` |
| `relative_search_radius` | `c_double` |
| `use_closest_if_none_found` | `c_bool` |
| `minimum_number_of_samples` | `c_int` |
**方法索引**
- [`from_interpolationparameters`](#cinterpolationparameters-from-interpolationparameters)
### `CInterpolationParameters.from_interpolationparameters` {#cinterpolationparameters-from-interpolationparameters}
```python
from_interpolationparameters(interpolation_parameters: InterpolationParameters) -> CInterpolationParameters
```
修饰器:`staticmethod`。
根据给定的 InterpolationParameters 实例创建新的 `CInterpolationParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `interpolation_parameters` | `InterpolationParameters` | `必填` | 插值参数。 |
**返回值**
- **`CInterpolationParameters`**:为给定 InterpolationParameters 创建的 C 数据结构。
## `COrthogonalizationParameters` {#corthogonalizationparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 OrthogonalizationParameters 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`outer_iterations`(`c_int`)**:正交化的外层迭代次数。
- **`boundary_iterations`(`c_int`)**:网格正交化过程中 itatp 内的边界迭代次数。
- **`inner_iterations`(`c_int`)**:网格正交化过程中 itbnd 内的内部迭代次数。
- **`orthogonalization_to_smoothing_factor`(`c_double`)**:控制网格平滑(0)与网格正交化(1)之间权重的系数。
- **`orthogonalization_to_smoothing_factor_at_boundary`(`c_double`)**:边界上的最小 ATPF 值。
- **`areal_to_angle_smoothing_factor`(`c_double`)**:在平滑器(1.0)与面积均匀化(0.0)之间调节的系数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `outer_iterations` | `c_int` |
| `boundary_iterations` | `c_int` |
| `inner_iterations` | `c_int` |
| `orthogonalization_to_smoothing_factor` | `c_double` |
| `orthogonalization_to_smoothing_factor_at_boundary` | `c_double` |
| `areal_to_angle_smoothing_factor` | `c_double` |
**方法索引**
- [`from_orthogonalizationparameters`](#corthogonalizationparameters-from-orthogonalizationparameters)
### `COrthogonalizationParameters.from_orthogonalizationparameters` {#corthogonalizationparameters-from-orthogonalizationparameters}
```python
from_orthogonalizationparameters(orthogonalization_parameters: OrthogonalizationParameters) -> COrthogonalizationParameters
```
修饰器:`staticmethod`。
根据给定的 OrthogonalizationParameters 实例创建新的 `COrthogonalizationParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `orthogonalization_parameters` | `OrthogonalizationParameters` | `必填` | 正交化参数。 |
**返回值**
- **`COrthogonalizationParameters`**:为给定 OrthogonalizationParameters 创建的 C 数据结构。
## `CMeshRefinementParameters` {#cmeshrefinementparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 MeshRefinementParameters 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`max_refinement_iterations`(`c_int`)**:最大加密迭代次数。
- **`refine_intersected`(`c_int`)**:是否处理与多边形相交的网格面(1 为是,0 为否)。
- **`use_mass_center_when_refining`(`c_int`)**:加密过程中划分网格面时是否使用质心(1 为是,0 为否)。
- **`min_edge_size`(`c_double`)**:最小网格单元尺寸。
- **`refinement_type`(`c_int`)**:加密判据类型。
- **`connect_hanging_nodes`(`c_int`)**:是否在迭代结束时连接悬挂节点。
- **`account_for_samples_outside`(`c_int`)**:是否考虑网格面外的采样数据。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `max_refinement_iterations` | `c_int` |
| `refine_intersected` | `c_int` |
| `use_mass_center_when_refining` | `c_int` |
| `min_edge_size` | `c_double` |
| `refinement_type` | `c_int` |
| `connect_hanging_nodes` | `c_int` |
| `account_for_samples_outside_face` | `c_int` |
| `smoothing_iterations` | `c_int` |
| `max_courant_time` | `c_double` |
| `directional_refinement` | `c_int` |
**方法索引**
- [`from_meshrefinementparameters`](#cmeshrefinementparameters-from-meshrefinementparameters)
### `CMeshRefinementParameters.from_meshrefinementparameters` {#cmeshrefinementparameters-from-meshrefinementparameters}
```python
from_meshrefinementparameters(mesh_refinement_parameters: MeshRefinementParameters) -> CMeshRefinementParameters
```
修饰器:`staticmethod`。
根据给定的 MeshRefinementParameters 实例创建新的 `CMeshRefinementParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `mesh_refinement_parameters` | `MeshRefinementParameters` | `必填` | 网格加密参数。 |
**返回值**
- **`CMeshRefinementParameters`**:为给定 MeshRefinementParameters 创建的 C 数据结构。
## `CMakeGridParameters` {#cmakegridparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 MakeGridParameters 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`num_columns`(`c_int`)**:x 方向的列数。
- **`num_rows`(`c_int`)**:y 方向的行数。(原文称为列数。)
- **`angle`(`c_double`)**:网格角度。
- **`origin_x`(`c_double`)**:左下角原点的 x 坐标。
- **`origin_y`(`c_double`)**:左下角原点的 y 坐标。
- **`block_size_x`(`c_double`)**:x 方向的网格块尺寸,仅用于方形网格。
- **`block_size_y`(`c_double`)**:y 方向的网格块尺寸,仅用于方形网格。
- **`upper_right_x`(`c_double`)**:右上角的 x 坐标。
- **`upper_right_y`(`c_double`)**:右上角的 y 坐标。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `num_columns` | `c_int` |
| `num_rows` | `c_int` |
| `angle` | `c_double` |
| `origin_x` | `c_double` |
| `origin_y` | `c_double` |
| `block_size_x` | `c_double` |
| `block_size_y` | `c_double` |
| `upper_right_x` | `c_double` |
| `upper_right_y` | `c_double` |
**方法索引**
- [`from_makegridparameters`](#cmakegridparameters-from-makegridparameters)
### `CMakeGridParameters.from_makegridparameters` {#cmakegridparameters-from-makegridparameters}
```python
from_makegridparameters(make_grid_parameters: MakeGridParameters) -> CMakeGridParameters
```
修饰器:`staticmethod`。
根据给定的 MeshRefinementParameters 实例创建新的 `CMeshRefinementParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `make_grid_parameters` | `MakeGridParameters` | `必填` | 网格生成参数。 |
**返回值**
- **`CMakeGridParameters`**:为给定 MakeGridParameters 创建的 C 数据结构。
## `CMesh1d` {#cmesh1d}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 Mesh1D 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`edge_nodes`(`POINTER(c_int)`)**:组成每条一维网格边的节点。
- **`node_x`(`POINTER(c_double)`)**:节点的 x 坐标。
- **`node_y`(`POINTER(c_double)`)**:节点的 y 坐标。
- **`num_nodes`(`c_int`)**:节点数。
- **`num_valid_nodes`(`c_int`)**:有效网格节点数。
- **`num_edges`(`c_int`)**:边数。
- **`num_valid_edges`(`c_int`)**:有效边数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `edge_nodes` | `POINTER(c_int)` |
| `node_x` | `POINTER(c_double)` |
| `node_y` | `POINTER(c_double)` |
| `num_nodes` | `c_int` |
| `num_valid_nodes` | `c_int` |
| `num_edges` | `c_int` |
| `num_valid_edges` | `c_int` |
**方法索引**
- [`from_mesh1d`](#cmesh1d-from-mesh1d)
- [`allocate_memory`](#cmesh1d-allocate-memory)
### `CMesh1d.from_mesh1d` {#cmesh1d-from-mesh1d}
```python
from_mesh1d(mesh1d: Mesh1d) -> CMesh1d
```
修饰器:`staticmethod`。
根据给定的 Mesh1d 实例创建新的 CMesh 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `mesh1d` | `Mesh1d` | `必填` | 持有状态的 NumPy 数组封装对象。 |
**返回值**
- **`CMesh1d`**:创建的 CMesh1d 实例。
### `CMesh1d.allocate_memory` {#cmesh1d-allocate-memory}
```python
allocate_memory(self) -> Mesh1d
```
根据名称以 `num_` 开头的参数分配数据内存。 随后将指针指向新分配的内存。 内存由此方法返回的 Mesh1d 实例持有。
**返回值**
- **`Mesh1d`**:持有已分配内存的对象。
## `CContacts` {#ccontacts}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 Contacts 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`mesh1d_indices`(`POINTER(c_int)`)**:一维网格节点的索引。
- **`mesh2d_indices`(`POINTER(c_int)`)**:二维网格面的索引。
- **`num_contacts`(`c_int`)**:连接数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `mesh1d_indices` | `POINTER(c_int)` |
| `mesh2d_indices` | `POINTER(c_int)` |
| `num_contacts` | `c_int` |
**方法索引**
- [`from_contacts`](#ccontacts-from-contacts)
- [`allocate_memory`](#ccontacts-allocate-memory)
### `CContacts.from_contacts` {#ccontacts-from-contacts}
```python
from_contacts(contacts: Contacts) -> CContacts
```
修饰器:`staticmethod`。
根据给定的 Contacts 实例创建新的 `CContacts` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `contacts` | `Contacts` | `必填` | 网格连接。 |
**返回值**
- **`CContacts`**:为给定 Contacts 创建的 C 数据结构。
### `CContacts.allocate_memory` {#ccontacts-allocate-memory}
```python
allocate_memory(self) -> Contacts
```
根据名称以 `num_` 开头的参数分配数据内存。 随后将指针指向新分配的内存。 内存由此方法返回的 Contacts 实例持有。
**返回值**
- **`Contacts`**:持有已分配内存的对象。
## `CCurvilinearGrid` {#ccurvilineargrid}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 Curvilinear 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`node_x`(`POINTER(c_double)`)**:节点的 x 坐标。
- **`node_y`(`POINTER(c_double)`)**:节点的 y 坐标。
- **`num_m`(`c_int`)**:沿 m 方向的曲线网格节点数。
- **`num_n`(`c_int`)**:沿 n 方向的曲线网格节点数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `node_x` | `POINTER(c_double)` |
| `node_y` | `POINTER(c_double)` |
| `num_m` | `c_int` |
| `num_n` | `c_int` |
**方法索引**
- [`from_curvilinearGrid`](#ccurvilineargrid-from-curvilineargrid)
- [`allocate_memory`](#ccurvilineargrid-allocate-memory)
### `CCurvilinearGrid.from_curvilinearGrid` {#ccurvilineargrid-from-curvilineargrid}
```python
from_curvilinearGrid(curvilinear_grid: CurvilinearGrid) -> CCurvilinearGrid
```
修饰器:`staticmethod`。
根据给定的 CurvilinearGrid 实例创建新的 CMesh 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `curvilinear_grid` | `CurvilinearGrid` | `必填` | 持有状态的 NumPy 数组封装对象。 |
**返回值**
- **`CCurvilinearGrid`**:创建的 CCurvilinearGrid 实例。
### `CCurvilinearGrid.allocate_memory` {#ccurvilineargrid-allocate-memory}
```python
allocate_memory(self) -> CurvilinearGrid
```
根据名称以 `num_` 开头的参数分配数据内存。 随后将指针指向新分配的内存。 内存由此方法返回的 CurvilinearGrid 实例持有。
**返回值**
- **`CurvilinearGrid`**:持有已分配内存的对象。
## `CCurvilinearParameters` {#ccurvilinearparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 CurvilinearParameters 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`m_refinement`(`c_int`)**:生成规则网格时的 m 方向加密系数。
- **`n_refinement`(`c_int`)**:生成规则网格时的 n 方向加密系数。
- **`smoothing_iterations`(`c_int`)**:规则网格平滑的内部迭代次数。
- **`smoothing_parameter`(`c_double`)**:平滑参数。
- **`attraction_parameter`(`c_double`)**:吸引/排斥参数。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `m_refinement` | `c_int` |
| `n_refinement` | `c_int` |
| `smoothing_iterations` | `c_int` |
| `smoothing_parameter` | `c_double` |
| `attraction_parameter` | `c_double` |
**方法索引**
- [`from_curvilinearParameters`](#ccurvilinearparameters-from-curvilinearparameters)
### `CCurvilinearParameters.from_curvilinearParameters` {#ccurvilinearparameters-from-curvilinearparameters}
```python
from_curvilinearParameters(curvilinear_parameters: CurvilinearParameters) -> CCurvilinearParameters
```
修饰器:`staticmethod`。
根据给定的 CurvilinearParameters 实例创建新的 `CCurvilinearParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `curvilinear_parameters` | `CurvilinearParameters` | `必填` | 曲线网格参数。 |
**返回值**
- **`CCurvilinearParameters`**:为给定 CurvilinearParameters 创建的 C 数据结构。
## `CSplinesToCurvilinearParameters` {#csplinestocurvilinearparameters}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 SplinesToCurvilinearParameters 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`aspect_ratio`(`c_double`)**:纵横比。
- **`aspect_ratio_grow_factor`(`c_double`)**:纵横比增长系数。
- **`average_width`(`c_double`)**:中心样条曲线上的平均网格宽度。
- **`curvature_adapted_grid_spacing`(`c_int`)**:随曲率调整的网格间距。
- **`grow_grid_outside`(`c_int`)**:是否在指定网格高度之外扩展网格。
- **`maximum_num_faces_in_uniform_part`(`c_int`)**:均匀部分的最大层数。
- **`nodes_on_top_of_each_other_tolerance`(`c_double`)**:节点重合判定容差。
- **`min_cosine_crossing_angles`(`c_double`)**:交叉角余弦绝对值允许的最小值。
- **`check_front_collisions`(`c_int`)**:是否检查与前沿其他部分的碰撞。
- **`remove_skinny_triangles`(`c_int`)**:是否检查与前沿其他部分的碰撞。(源说明与上一字段重复;字段名称表示移除细长三角形。)
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `aspect_ratio` | `c_double` |
| `aspect_ratio_grow_factor` | `c_double` |
| `average_width` | `c_double` |
| `curvature_adapted_grid_spacing` | `c_int` |
| `grow_grid_outside` | `c_int` |
| `maximum_num_faces_in_uniform_part` | `c_int` |
| `nodes_on_top_of_each_other_tolerance` | `c_double` |
| `min_cosine_crossing_angles` | `c_double` |
| `check_front_collisions` | `c_int` |
| `remove_skinny_triangles` | `c_int` |
**方法索引**
- [`from_splinesToCurvilinearParameters`](#csplinestocurvilinearparameters-from-splinestocurvilinearparameters)
### `CSplinesToCurvilinearParameters.from_splinesToCurvilinearParameters` {#csplinestocurvilinearparameters-from-splinestocurvilinearparameters}
```python
from_splinesToCurvilinearParameters(splines_to_curvilinear_parameters: SplinesToCurvilinearParameters) -> CSplinesToCurvilinearParameters
```
修饰器:`staticmethod`。
根据给定的 OrthogonalizationParameters 实例创建新的 `COrthogonalizationParameters` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `splines_to_curvilinear_parameters` | `SplinesToCurvilinearParameters` | `必填` | 源码未单独提供参数说明。 |
原文还列出了以下参数说明(名称可能与当前签名不一致):
- **`orthogonalization_parameters`(`OrthogonalizationParameters`)**:正交化参数。
**返回值**
- **`COrthogonalizationParameters`**:为给定 OrthogonalizationParameters 创建的 C 数据结构。
## `CGriddedSamples` {#cgriddedsamples}
继承:`Structure`。
仅供内部使用的 C 数据结构。 表示 MeshKernel API 定义的 GriddedSamples 结构体。
用于与 MeshKernel 动态链接库通信。
该类的 `_fields_` 属性包含以下字段:
- **`num_x`(`c_int`)**:网格采样数据在 x 方向上的坐标数。
- **`num_y`(`c_int`)**:网格采样数据在 y 方向上的坐标数。
- **`x_origin`(`c_double`)**:采样网格原点的 x 坐标。
- **`y_origin`(`c_double`)**:采样网格原点的 y 坐标。
- **`cell_size`(`c_int`)**:固定的采样网格单元尺寸。
- **`x_coordinates`(`POINTER(c_double)`)**:若不为 nullptr,则指定 x 方向非均匀网格间距对应的坐标。
- **`y_coordinates`(`POINTER(c_double)`)**:若不为 nullptr,则指定 y 方向非均匀网格间距对应的坐标。
- **`values`(`POINTER(c_double)`)**:采样值。
**C 结构体字段(按源码顺序)**
| 字段 | C 类型 |
| --- | --- |
| `num_x` | `c_int` |
| `num_y` | `c_int` |
| `x_origin` | `c_double` |
| `y_origin` | `c_double` |
| `cell_size` | `c_double` |
| `x_coordinates` | `POINTER(c_double)` |
| `y_coordinates` | `POINTER(c_double)` |
| `values` | `c_void_p` |
| `value_type` | `c_int` |
**方法索引**
- [`from_griddedSamples`](#cgriddedsamples-from-griddedsamples)
### `CGriddedSamples.from_griddedSamples` {#cgriddedsamples-from-griddedsamples}
```python
from_griddedSamples(gridded_samples: GriddedSamples) -> CGriddedSamples
```
修饰器:`staticmethod`。
根据给定的 GriddedSamples 实例创建新的 `CGriddedSamples` 实例。
**参数**
| 名称 | 类型 | 默认值 | 中文说明 |
| --- | --- | --- | --- |
| `gridded_samples` | `GriddedSamples` | `必填` | 网格采样数据。 |
**返回值**
- **`CGriddedSamples`**:为给定 CGriddedSamples 创建的 C 数据结构。