6#include <kernel/geometry/test_aux/standard_tria.hpp> 
    7#include <kernel/geometry/test_aux/copy_comp_set.hpp> 
   15      TriaMesh* create_tria_mesh_2d(
int orientation)
 
   18        Index num_entities[] =
 
   26        TriaMesh* mesh = 
new TriaMesh(num_entities);
 
   49        static const Real vtx0[3*2] =
 
   57        static const Index v_e0[3*2] =
 
   65        static const Index v_t0[3] =
 
   71        static const Index e_t0[3] =
 
   97        static const Real vtx1[3*2] =
 
  105        static const Index v_e1[3*2] =
 
  113        static const Index v_t1[3*1] =
 
  119        static const Index e_t1[1*3] =
 
  145        static const Real vtx2[3*2] =
 
  153        static const Index v_e2[3*2] =
 
  161        static const Index v_t2[3*1] =
 
  167        static const Index e_t2[3*1] =
 
  193        static const Real vtx3[3*2] =
 
  201        static const Index v_e3[3*2] =
 
  209        static const Index v_t3[3*1] =
 
  215        static const Index e_t3[3] =
 
  223            copy_vtx(mesh->get_vertex_set(), vtx0);
 
  224            copy_idx(mesh->get_index_set<1,0>(), v_e0);
 
  225            copy_idx(mesh->get_index_set<2,0>(), v_t0);
 
  226            copy_idx(mesh->get_index_set<2,1>(), e_t0);
 
  229            copy_vtx(mesh->get_vertex_set(), vtx1);
 
  230            copy_idx(mesh->get_index_set<1,0>(), v_e1);
 
  231            copy_idx(mesh->get_index_set<2,0>(), v_t1);
 
  232            copy_idx(mesh->get_index_set<2,1>(), e_t1);
 
  235            copy_vtx(mesh->get_vertex_set(), vtx2);
 
  236            copy_idx(mesh->get_index_set<1,0>(), v_e2);
 
  237            copy_idx(mesh->get_index_set<2,0>(), v_t2);
 
  238            copy_idx(mesh->get_index_set<2,1>(), e_t2);
 
  241            copy_vtx(mesh->get_vertex_set(), vtx3);
 
  242            copy_idx(mesh->get_index_set<1,0>(), v_e3);
 
  243            copy_idx(mesh->get_index_set<2,0>(), v_t3);
 
  244            copy_idx(mesh->get_index_set<2,1>(), e_t3);
 
  253      void validate_refined_tria_mesh_2d(
const TriaMesh& mesh, 
int orientation)
 
  257        if(mesh.get_num_entities(0) != 6)
 
  258          throw String(
"Vertex count mismatch");
 
  259        if(mesh.get_num_entities(1) != 9)
 
  260          throw String(
"Edge count mismatch");
 
  261        if(mesh.get_num_entities(2) != 4)
 
  262          throw String(
"Triangle count mismatch");
 
  268        static const Real vtx0[] =
 
  279        static const Index v_e0[] =
 
  293        static const Index v_t0[] =
 
  302        static const Index e_t0[] =
 
  313        static const Real vtx1[] =
 
  324        static const Index v_e1[] =
 
  338        static const Index v_t1[] =
 
  347        static const Index e_t1[] =
 
  358        static const Real vtx2[] =
 
  369        static const Index v_e2[] =
 
  383        static const Index v_t2[] =
 
  392        static const Index e_t2[] =
 
  403        static const Real vtx3[] =
 
  414        static const Index v_e3[] =
 
  428        static const Index v_t3[] =
 
  437        static const Index e_t3[] =
 
  449            if(!comp_vtx(mesh.get_vertex_set(), vtx0))
 
  450              throw String(
"Vertex coordinate refinement failure");
 
  453            if(!comp_idx(mesh.get_index_set<1,0>(), v_e0))
 
  454              throw String(
"Vertex-At-Edge index set refinement failure");
 
  457            if(!comp_idx(mesh.get_index_set<2,0>(), v_t0))
 
  458              throw String(
"Vertex-At-Triangle index set refinement failure");
 
  461            if(!comp_idx(mesh.get_index_set<2,1>(), e_t0))
 
  462              throw String(
"Edge-At-Triangle index set refinement failure");
 
  467            if(!comp_vtx(mesh.get_vertex_set(), vtx1))
 
  468              throw String(
"Vertex coordinate refinement failure");
 
  471            if(!comp_idx(mesh.get_index_set<1,0>(), v_e1))
 
  472              throw String(
"Vertex-At-Edge index set refinement failure");
 
  475            if(!comp_idx(mesh.get_index_set<2,0>(), v_t1))
 
  476              throw String(
"Vertex-At-Triangle index set refinement failure");
 
  479            if(!comp_idx(mesh.get_index_set<2,1>(), e_t1))
 
  480              throw String(
"Edge-At-Triangle index set refinement failure");
 
  485            if(!comp_vtx(mesh.get_vertex_set(), vtx2))
 
  486              throw String(
"Vertex coordinate refinement failure");
 
  489            if(!comp_idx(mesh.get_index_set<1,0>(), v_e2))
 
  490              throw String(
"Vertex-At-Edge index set refinement failure");
 
  493            if(!comp_idx(mesh.get_index_set<2,0>(), v_t2))
 
  494              throw String(
"Vertex-At-Triangle index set refinement failure");
 
  497            if(!comp_idx(mesh.get_index_set<2,1>(), e_t2))
 
  498              throw String(
"Edge-At-Triangle index set refinement failure");
 
  503            if(!comp_vtx(mesh.get_vertex_set(), vtx3))
 
  504              throw String(
"Vertex coordinate refinement failure");
 
  507            if(!comp_idx(mesh.get_index_set<1,0>(), v_e3))
 
  508              throw String(
"Vertex-At-Edge index set refinement failure");
 
  511            if(!comp_idx(mesh.get_index_set<2,0>(), v_t3))
 
  512              throw String(
"Vertex-At-Triangle index set refinement failure");
 
  515            if(!comp_idx(mesh.get_index_set<2,1>(), e_t3))
 
  516              throw String(
"Edge-At-Triangle index set refinement failure");
 
  525      TriaMesh* create_patch_tria_mesh_2d()
 
  528        Index num_entities[] =
 
  536        TriaMesh* mesh = 
new TriaMesh(num_entities);
 
  566        static const Real vtx0[3*8] =
 
  576        static const Index v_e0[12*2] =
 
  589        static const Index v_t0[6*4] =
 
  598        static const Index e_t0[6*4] =
 
  606        copy_vtx(mesh->get_vertex_set(), vtx0);
 
  607        copy_idx(mesh->get_index_set<1,0>(), v_e0);
 
  608        copy_idx(mesh->get_index_set<2,0>(), v_t0);
 
  609        copy_idx(mesh->get_index_set<2,1>(), e_t0);
 
  615      void validate_refined_patch_tria_mesh_2d(
const TriaMesh& mesh)
 
  619        if(mesh.get_num_entities(0) != 13)
 
  620          throw String(
"Vertex count mismatch");
 
  621        if(mesh.get_num_entities(1) != 28)
 
  622          throw String(
"Edge count mismatch");
 
  623        if(mesh.get_num_entities(2) != 16)
 
  624          throw String(
"Triangle count mismatch");
 
  627        static const Real vtx0[] =
 
  645        static const Index v_e0[] =
 
  678        static const Index v_t0[] =
 
  699        static const Index e_t0[] =
 
  720        if(!comp_vtx(mesh.get_vertex_set(), vtx0))
 
  721          throw String(
"Vertex coordinate refinement failure");
 
  724        if(!comp_idx(mesh.get_index_set<1,0>(), v_e0))
 
  725          throw String(
"Vertex-At-Edge index set refinement failure");
 
  728        if(!comp_idx(mesh.get_index_set<2,0>(), v_t0))
 
  729          throw String(
"Vertex-At-Triangle index set refinement failure");
 
  732        if(!comp_idx(mesh.get_index_set<2,1>(), e_t0))
 
  733          throw String(
"Edge-At-Triangle index set refinement failure");
 
  737      TriaSubMesh* create_patch_tria_submesh_2d()
 
  765        Index num_entities[] =
 
  773        TriaSubMesh* mesh = 
new TriaSubMesh(num_entities, 
true);
 
  775        std::unique_ptr<TriaSubMesh::AttributeSetType> my_attrib_set(
new TriaSubMesh::AttributeSetType(num_entities[0],2));
 
  777        mesh->add_attribute(std::move(my_attrib_set), 
"TriaSubAttributeSet");
 
  787        copy_attr(*(mesh->find_attribute(
"TriaSubAttributeSet")), attr);
 
  798        copy_idx(mesh->get_index_set<1,0>(), v_e);
 
  806        copy_idx(mesh->get_index_set<2,0>(), v_t);
 
  814        copy_idx(mesh->get_index_set<2,1>(), e_t);
 
  821        copy_trg(mesh->get_target_set<0>(), vti);
 
  828        copy_trg(mesh->get_target_set<1>(), eti);
 
  835        copy_trg(mesh->get_target_set<2>(), tti);
 
  840      void validate_refined_patch_tria_submesh_2d(
const TriaSubMesh& mesh)
 
  844        if(mesh.get_num_entities(0) != 9)
 
  845          throw String(
"Vertex count mismatch");
 
  846        if(mesh.get_num_entities(1) != 16)
 
  847          throw String(
"Edge count mismatch");
 
  848        if(mesh.get_num_entities(2) != 8)
 
  849          throw String(
"Triangle count mismatch");
 
  865        if(!comp_attr(*(mesh.find_attribute(
"TriaSubAttributeSet")), attr))
 
  866          throw String(
"Attribute refinement failure");
 
  888        if(!comp_idx(mesh.get_index_set<1,0>(), v_e))
 
  889          throw String(
"Vertex-At-Edge index set refinement failure");
 
  903        if(!comp_idx(mesh.get_index_set<2,0>(), v_t))
 
  904          throw String(
"Vertex-At-Tria index set refinement failure");
 
  918        if(!comp_idx(mesh.get_index_set<2,1>(), e_t))
 
  919          throw String(
"Edges-At-Tria refinement failure");
 
  924          3, 0, 1, 2, 8, 9, 10, 12, 5
 
  926        if(!comp_trg(mesh.get_target_set<0>(), vti))
 
  927          throw String(
"Vertex-Target-Indices refinement failure");
 
  932          6, 7, 9, 8, 10, 11, 15, 14, 1, 0, 26, 25, 27, 16, 18, 17
 
  934        if(!comp_trg(mesh.get_target_set<1>(), eti))
 
  935          throw String(
"Edge-Target-Indices refinement failure");
 
  940          13, 12, 14, 15, 0, 2, 1, 3
 
  942        if(!comp_trg(mesh.get_target_set<2>(), tti))
 
  943          throw String(
"Tria-Target-Indices refinement failure");
 
  946      TriaSubMesh* create_patch_edge_submesh_2d()
 
  949        Index num_entities[] =
 
  957        TriaSubMesh* mesh = 
new TriaSubMesh(num_entities, 
true);
 
  959        std::unique_ptr<TriaSubMesh::AttributeSetType> my_attrib_set(
new TriaSubMesh::AttributeSetType(num_entities[0]));
 
  961        mesh->add_attribute(std::move(my_attrib_set), 
"PatchEdgeAttribute");
 
  972        copy_attr(*(mesh->find_attribute(
"PatchEdgeAttribute")), attr);
 
  982        copy_idx(mesh->get_index_set<1,0>(), v_e);
 
  989        copy_trg(mesh->get_target_set<0>(), vti);
 
  996        copy_trg(mesh->get_target_set<1>(), eti);
 
 1002      void validate_refined_patch_edge_submesh_2d(
const TriaSubMesh& mesh)
 
 1006        if(mesh.get_num_entities(0) != 9)
 
 1007          throw String(
"Vertex count mismatch");
 
 1008        if(mesh.get_num_entities(1) != 8)
 
 1009          throw String(
"Edge count mismatch");
 
 1025        if(!comp_attr(*(mesh.find_attribute(
"PatchEdgeAttribute")), attr))
 
 1026          throw String(
"Attribute refinement failure");
 
 1040        if(!comp_idx(mesh.get_index_set<1,0>(), v_e))
 
 1041          throw String(
"Vertex-At-Edge index set refinement failure");
 
 1046          1, 4, 2, 3, 0, 6, 11, 12, 8
 
 1048        if(!comp_trg(mesh.get_target_set<0>(), vti))
 
 1049          throw String(
"Vertex-Target-Indices refinement failure");
 
 1054          2, 3, 12, 13, 15, 14, 6, 7
 
 1056        if(!comp_trg(mesh.get_target_set<1>(), eti))
 
 1057          throw String(
"Edge-Target-Indices refinement failure");
 
#define XABORTM(msg)
Abortion macro definition with custom message.
double Real
Real data type.
String stringify(const T_ &item)
Converts an item into a String.
std::uint64_t Index
Index data type.