Destination tree¶
dest_tree
¶
DestinationTree
¶
DestinationTree(dest_coordinates: ndarray, src_coordinates: ndarray, dest_ids: ndarray, config: InterpolationConfig, name: str | None = None)
Intialize the KDTree for fast search in the mechanical nodes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
dest_coordinates
|
ndarray
|
point coordinates array of destination mesh points |
required |
src_coordinates
|
ndarray
|
point coordinates array of source mesh points |
required |
dest_ids
|
ndarray
|
IDs of the destination nodes or elements |
required |
config
|
InterpolationConfig
|
Interpolation configuration parameters |
required |
name
|
str
|
Name of the tree, by default None |
None
|
Attributes:
| Name | Type | Description |
|---|---|---|
tree |
KDTree
|
KDTree built on the destination coordinates for fast neighbor search |
name |
str | None
|
Name of the tree |
ids |
ndarray
|
IDs of the destination nodes or elements |
config |
InterpolationConfig
|
Interpolation configuration parameters |
src_coordinates |
ndarray
|
point coordinates array of source mesh points |
idx_query |
ndarray
|
Indices of the neighbors in the destination mesh for each source point, obtained from the query method specified in the config |
Source code in src/interpcore/dest_tree.py
interpolate
¶
Perform the interpolation from source to destination nodes
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
vector_to_interpolate
|
ndarray
|
whatever vector that needs to be interpolated onto the destination mesh |
required |
Returns:
| Type | Description |
|---|---|
tuple[ndarray, ndarray]
|
Interpolated forces on mechanical nodes and unmapped forces |
Source code in src/interpcore/dest_tree.py
111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 | |