Generate the geometry the original way and report, per quantity, the largest discrepancy against the incrementally built one. Diagnostic only; gated by SELF_AMR_GEOM_VERIFY.
Whole-array maxima rather than per-element reporting: naming the quantity that diverges is what localizes the defect, and it keeps this to F2008 array intrinsics.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(AMRController2D), | intent(inout) | :: | this | |||
| type(Mesh2D), | intent(in) | :: | newMesh | |||
| type(SEMQuad), | intent(in) | :: | newGeom |
subroutine VerifyGeometry(this,newMesh,newGeom)
!! Generate the geometry the original way and report, per quantity, the largest discrepancy
!! against the incrementally built one. Diagnostic only; gated by SELF_AMR_GEOM_VERIFY.
!!
!! Whole-array maxima rather than per-element reporting: naming the quantity that diverges is
!! what localizes the defect, and it keeps this to F2008 array intrinsics.
implicit none
class(AMRController2D),intent(inout) :: this
type(Mesh2D),intent(in) :: newMesh
type(SEMQuad),intent(in) :: newGeom
! Local
type(SEMQuad) :: ref
call ref%Init(this%interp,newMesh%nElem)
call ref%GenerateFromMesh(newMesh)
print*,"GEOM_VERIFY nElem =",newMesh%nElem
print*,"GEOM_VERIFY max|d x%interior| =", &
maxval(abs(newGeom%x%interior-ref%x%interior))
print*,"GEOM_VERIFY max|d x%boundary| =", &
maxval(abs(newGeom%x%boundary-ref%x%boundary))
print*,"GEOM_VERIFY max|d J%interior| =", &
maxval(abs(newGeom%J%interior-ref%J%interior))
print*,"GEOM_VERIFY max|d J%boundary| =", &
maxval(abs(newGeom%J%boundary-ref%J%boundary))
print*,"GEOM_VERIFY max|d dsdx%interior| =", &
maxval(abs(newGeom%dsdx%interior-ref%dsdx%interior))
print*,"GEOM_VERIFY max|d dsdx%boundary| =", &
maxval(abs(newGeom%dsdx%boundary-ref%dsdx%boundary))
print*,"GEOM_VERIFY max|d nHat%boundary| =", &
maxval(abs(newGeom%nHat%boundary-ref%nHat%boundary))
print*,"GEOM_VERIFY max|d nScale%boundary|=", &
maxval(abs(newGeom%nScale%boundary-ref%nScale%boundary))
call ref%Free()
endsubroutine VerifyGeometry