| 5037 | } // harmonic_interp |
| 5038 | |
| 5039 | void |
| 5040 | PatchMathOps::laplace(Pointer<CellData<NDIM, double>> dst, |
| 5041 | const double alpha, |
| 5042 | const double beta, |
| 5043 | const Pointer<CellData<NDIM, double>> src1, |
| 5044 | const double gamma, |
| 5045 | const Pointer<CellData<NDIM, double>> src2, |
| 5046 | const Pointer<Patch<NDIM>> patch, |
| 5047 | const int l, |
| 5048 | const int m, |
| 5049 | const int n) const |
| 5050 | { |
| 5051 | const Pointer<CartesianPatchGeometry<NDIM>> pgeom = patch->getPatchGeometry(); |
| 5052 | const double* const dx = pgeom->getDx(); |
| 5053 | |
| 5054 | double* const F = dst->getPointer(l); |
| 5055 | const int F_ghosts = (dst->getGhostCellWidth()).max(); |
| 5056 | |
| 5057 | const double* const U = src1->getPointer(m); |
| 5058 | const int U_ghosts = (src1->getGhostCellWidth()).max(); |
| 5059 | |
| 5060 | const Box<NDIM>& patch_box = patch->getBox(); |
| 5061 | |
| 5062 | #if !defined(NDEBUG) |
| 5063 | if (F_ghosts != (dst->getGhostCellWidth()).min()) |
| 5064 | { |
| 5065 | TBOX_ERROR("PatchMathOps::laplace():\n" |
| 5066 | << " dst does not have uniform ghost cell widths" << std::endl); |
| 5067 | } |
| 5068 | |
| 5069 | if (U_ghosts != (src1->getGhostCellWidth()).min()) |
| 5070 | { |
| 5071 | TBOX_ERROR("PatchMathOps::laplace():\n" |
| 5072 | << " src1 does not have uniform ghost cell widths" << std::endl); |
| 5073 | } |
| 5074 | |
| 5075 | if (src1 == dst) |
| 5076 | { |
| 5077 | TBOX_ERROR("PatchMathOps::laplace():\n" |
| 5078 | << " src1 == dst." << std::endl); |
| 5079 | } |
| 5080 | |
| 5081 | if ((src1 == src2) && (gamma != 0.0)) |
| 5082 | { |
| 5083 | TBOX_ERROR("PatchMathOps::laplace():\n" |
| 5084 | << " src1 == src2 but gamma is nonzero." << std::endl); |
| 5085 | } |
| 5086 | |
| 5087 | const Box<NDIM>& U_box = src1->getGhostBox(); |
| 5088 | const Box<NDIM> U_box_shrunk = Box<NDIM>::grow(U_box, -1); |
| 5089 | |
| 5090 | if ((!U_box_shrunk.contains(patch_box.lower())) || (!U_box_shrunk.contains(patch_box.upper()))) |
| 5091 | { |
| 5092 | TBOX_ERROR("PatchMathOps::laplace():\n" |
| 5093 | << " src1 has insufficient ghost cell width" << std::endl); |
| 5094 | } |
| 5095 | |
| 5096 | if (patch_box != dst->getBox()) |
no test coverage detected