| 3934 | } // grad |
| 3935 | |
| 3936 | void |
| 3937 | PatchMathOps::interp(Pointer<CellData<NDIM, double>> dst, |
| 3938 | const Pointer<FaceData<NDIM, double>> src, |
| 3939 | const Pointer<Patch<NDIM>> patch) const |
| 3940 | { |
| 3941 | const int U_ghosts = (dst->getGhostCellWidth()).max(); |
| 3942 | const int v_ghosts = (src->getGhostCellWidth()).max(); |
| 3943 | |
| 3944 | const Box<NDIM>& patch_box = patch->getBox(); |
| 3945 | |
| 3946 | #if !defined(NDEBUG) |
| 3947 | if (dst->getDepth() != NDIM * src->getDepth()) |
| 3948 | { |
| 3949 | TBOX_ERROR("PatchMathOps::interp():\n" |
| 3950 | << " src and dst have incompatible depths" << std::endl); |
| 3951 | } |
| 3952 | |
| 3953 | if (U_ghosts != (dst->getGhostCellWidth()).min()) |
| 3954 | { |
| 3955 | TBOX_ERROR("PatchMathOps::interp():\n" |
| 3956 | << " dst does not have uniform ghost cell widths" << std::endl); |
| 3957 | } |
| 3958 | |
| 3959 | if (v_ghosts != (src->getGhostCellWidth()).min()) |
| 3960 | { |
| 3961 | TBOX_ERROR("PatchMathOps::interp():\n" |
| 3962 | << " src does not have uniform ghost cell widths" << std::endl); |
| 3963 | } |
| 3964 | |
| 3965 | if (patch_box != dst->getBox()) |
| 3966 | { |
| 3967 | TBOX_ERROR("PatchMathOps::interp():\n" |
| 3968 | << " dst and src must live on the same patch" << std::endl); |
| 3969 | } |
| 3970 | |
| 3971 | if (patch_box != src->getBox()) |
| 3972 | { |
| 3973 | TBOX_ERROR("PatchMathOps::interp():\n" |
| 3974 | << " dst and src must live on the same patch" << std::endl); |
| 3975 | } |
| 3976 | #endif |
| 3977 | |
| 3978 | for (int depth = 0; depth < src->getDepth(); ++depth) |
| 3979 | { |
| 3980 | // Interpolate. |
| 3981 | double* const U = dst->getPointer(NDIM * depth); |
| 3982 | |
| 3983 | const double* const v0 = src->getPointer(0, depth); |
| 3984 | const double* const v1 = src->getPointer(1, depth); |
| 3985 | #if (NDIM == 3) |
| 3986 | const double* const v2 = src->getPointer(2, depth); |
| 3987 | #endif |
| 3988 | |
| 3989 | F_TO_C_INTERP_FC(U, |
| 3990 | U_ghosts, |
| 3991 | v0, |
| 3992 | v1, |
| 3993 | #if (NDIM == 3) |
no test coverage detected