// SPDX-FileCopyrightText: Copyright © DUNE Project contributors, see file LICENSE.md in module root // SPDX-License-Identifier: LGPL-2.1-or-later #include "config.h" #include #include #include #include #include "evm.h" #include "gm.h" #include "rm.h" USING_UGDIM_NAMESPACE USING_UG_NAMESPACE static bool CheckVolumes(REFRULE const *Rule) { bool pass = true; DOUBLE_VECTOR coords [MAX_CORNERS_OF_ELEM+MAX_NEW_CORNERS_DIM]; DOUBLE_VECTOR coord; DOUBLE_VECTOR p[MAX_CORNERS_OF_ELEM]; /* this function work only for TETRAHEDRA!!! */ int tag = TETRAHEDRON; /* reset coords */ for (int i=0; imark != 0) { printf("Rule %d :sum over sons = %f != 1\n",Rule->mark,sum); pass = false; } return pass; } int main(int argc, char** argv) { Dune::MPIHelper::instance(argc, argv); InitUg(&argc, &argv); bool pass = true; std::printf("Testing %d refinement rules for the tetrahedron...\n", MaxRules[TETRAHEDRON]); REFRULE* rules = RefRules[TETRAHEDRON]; for (int i = 0; i < MaxRules[TETRAHEDRON]; ++i) pass = pass && CheckVolumes(rules + i); ExitUg(); return pass ? 0 : 1; }