# Conflicts: # .obsidian/copilot-index-ef6af226357d1e8b24528ffe939abb69.json # .obsidian/plugins/copilot/data.json # .obsidian/workspace.json # 多体+耦合求解器/数据结构讨论.md
3.2 KiB
问题1 结构体定义是否需要加大量option
=======
43e7b08163
pub struct MorisonMOutput {
pub memberid: i32, // Member ID for requested output [-]
pub noutloc: i32, // The number of requested output locations [-]
pub nodelocs: Option<Vec>, // Normalized locations along user-specified member for the outputs [-]
pub memberidindx: i32, // Index for member in the master list [-]
pub meshindx1: Option<Vec>, // Index of node in Mesh for the start of the member element [-]
pub meshindx2: Option<Vec>, // Index of node in Mesh for the end of the member element [-]
pub memberindx1: Option<Vec>, // Index of Member nodes for the start of the member element [-]
pub memberindx2: Option<Vec>, // Index of Member nodes for the end of the member element [-]
pub s: Option<Vec>, // Linear interpolation factor between node1 and node2 for the output location [-]
}
# 问题2 array数组定义
<<<<<<< HEAD
```rust
=======
43e7b08163
pub struct AD_Init{ pub Ct_final: ArrayBase<OwnedRepr, Dim<[usize; 3]>>,
pub Cq_final: ArrayBase<OwnedRepr, Dim<[usize; 3]>>,
pub CP_final: ArrayBase<OwnedRepr, Dim<[usize; 1]>>,
pub position_g: Vec<[ArrayBase<OwnedRepr, Dim<[usize; 1]>>; 3]>,
pub trans_disp: Vec<[ArrayBase<OwnedRepr, Dim<[usize; 1]>>; 3]>, }
impl AD_Init {
pub fn new() -> Self { Ct_final: ArrayBase::zeros((0, 0, 0)),
Cq_final: ArrayBase::zeros((0, 0, 0)),
CP_final: ArrayBase::zeros(0),
position_g: Vec::new(),
trans_disp: Vec::new(), } }
<<<<<<< HEAD
```rust
=======
43e7b08163
pub struct EDParameterType{ pub r_nodes: Array1, // 分析节点到轮毂的半径 pub pitch_axis: Array2, // 分析节点的变桨轴 pub twr_fasf: Array3, // 塔前后形状函数 pub twr_sssf: Array3, // 塔侧向形状函数 (ArrayBase<OwnedRepr, Dim<[usize; 3]>>) } impl EDParameterType {
pub fn new() -> EDParameterType {
EDParameterType { // 初始化一个任意维度 r_nodes: Array1::zeros(1), pitch_axis: Array2::zeros((1, 1)), twr_fasf: Array3::zeros((3, 3, 3)), twr_sssf: Array3::zeros((3, 3, 3)), } } }
<<<<<<< HEAD
```rust
=======
43e7b08163
// 在代码中根据需要创建维度 p.r_nodes = Array1::zeros(p.bld_nodes as usize); p.pitch_axis = Array2::zeros((p.num_bl as usize, p.bld_nodes as usize)); p.twr_fasf = Array3::zeros((2, p.t_top_node as usize+ 1, 3));