| 186 | } // init_meter_elements |
| 187 | |
| 188 | double |
| 189 | compute_flow_correction(const boost::multi_array<Vector, 1>& U_perimeter, |
| 190 | const Vector& U_centroid, |
| 191 | const boost::multi_array<Point, 1>& X_perimeter, |
| 192 | const Point& X_centroid) |
| 193 | { |
| 194 | double U_dot_dA = 0.0; |
| 195 | #if (NDIM == 2) |
| 196 | TBOX_ERROR("no support for 2D flow meters at this time!\n"); |
| 197 | NULL_USE(U_perimeter); |
| 198 | NULL_USE(U_centroid); |
| 199 | NULL_USE(X_perimeter); |
| 200 | NULL_USE(X_centroid); |
| 201 | #endif |
| 202 | #if (NDIM == 3) |
| 203 | const int num_perimeter_nodes = static_cast<int>(X_perimeter.shape()[0]); |
| 204 | for (int m = 0; m < num_perimeter_nodes; ++m) |
| 205 | { |
| 206 | const Vector& U_perimeter0(U_perimeter[m]); |
| 207 | const Point& X_perimeter0(X_perimeter[m]); |
| 208 | |
| 209 | const Vector& U_perimeter1(U_perimeter[(m + 1) % num_perimeter_nodes]); |
| 210 | const Point& X_perimeter1(X_perimeter[(m + 1) % num_perimeter_nodes]); |
| 211 | |
| 212 | // Compute the linear interpolation of the velocity at the center of the |
| 213 | // triangle. |
| 214 | const Vector U = (U_perimeter0 + U_perimeter1 + U_centroid) / 3.0; |
| 215 | |
| 216 | // Compute the area weighted normal to the triangle. |
| 217 | const Vector dA = 0.5 * (X_centroid - X_perimeter0).cross(X_centroid - X_perimeter1); |
| 218 | |
| 219 | // Compute the contribution to U_dot_dA. |
| 220 | U_dot_dA += U.dot(dA); |
| 221 | } |
| 222 | #endif |
| 223 | return U_dot_dA; |
| 224 | } // compute_flow_correction |
| 225 | |
| 226 | #if defined(IBAMR_HAVE_SILO) |
| 227 | /*! |
no test coverage detected