| 94 | |
| 95 | |
| 96 | Real MFdiff(const MultiFab& lhs, const MultiFab& rhs, |
| 97 | int strt_comp, int num_comp, int nghost, const std::string name = "", |
| 98 | bool relative = false) |
| 99 | { |
| 100 | MultiFab temp(lhs.boxArray(), lhs.DistributionMap(), lhs.nComp(), nghost); |
| 101 | Copy(temp, lhs, strt_comp, strt_comp, num_comp, nghost); |
| 102 | temp.minus(rhs, strt_comp, num_comp, nghost); |
| 103 | if (relative) { |
| 104 | temp.divide(rhs, strt_comp, num_comp, nghost); } |
| 105 | |
| 106 | if (name != "") |
| 107 | { amrex::VisMF::Write(temp, std::string("pltfiles/" + name)); } |
| 108 | |
| 109 | Real max_diff = 0; |
| 110 | for (int i=0; i<num_comp; ++i) |
| 111 | { |
| 112 | Real max_i = std::abs(temp.max(i)); |
| 113 | max_diff = (max_diff > max_i) ? max_diff : max_i; |
| 114 | } |
| 115 | |
| 116 | return max_diff; |
| 117 | } |
| 118 | |
| 119 | // ================================================ |
| 120 |
no test coverage detected