LCOV - code coverage report
Current view: top level - algs/PostBL - createblelements.cpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 50 175 28.6 %
Date: 2020-07-01 15:24:36 Functions: 3 3 100.0 %
Branches: 82 916 9.0 %

           Branch data     Line data    Source code
       1                 :            : #include "meshkit/PostBL.hpp"
       2                 :            : namespace MeshKit
       3                 :            : {
       4                 :          1 :   int PostBL::create_bl_elements(VerdictWrapper vw)
       5                 :            :   // ---------------------------------------------------------------------------
       6                 :            :   //! Function: Parser for reading the PostBL specification (.inp) file. \n
       7                 :            :   //! Input:    Command line arguments. \n
       8                 :            :   //! Output:   none \n
       9                 :            :   // ---------------------------------------------------------------------------
      10                 :            :   {
      11                 :          1 :     int qcount = 0;
      12                 :            :     
      13                 :            :     // Now start creating New elements
      14 [ +  - ][ +  - ]:          4 :     for (Range::iterator kter = quads.begin(); kter != quads.end(); ++kter){
         [ +  - ][ +  - ]
                 [ +  + ]
      15                 :          3 :         qcount++;        
      16         [ +  - ]:          3 :         std::vector<moab::EntityHandle> old_hex;
      17 [ +  - ][ +  - ]:          3 :         MBERRCHK(mb->get_adjacencies(&(*kter), 1, m_GD, false, old_hex),mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      18                 :            :         //      int this_quad_mat = -1;
      19                 :            :         //      MBERRCHK(mb->tag_get_data(MatIDTag, &old_hex[0], 1, &this_quad_mat), mb);
      20                 :          3 :         double jac = 0;
      21                 :            :         
      22 [ +  - ][ +  - ]:          3 :         MBERRCHK(mb->get_connectivity(&(*kter), 1, qconn),mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      23                 :            :         double one_node_in_quad[3];
      24                 :            :         
      25         [ +  + ]:         15 :         for (int i=0; i<m_BElemNodes; i++){
      26                 :         12 :             int node_tag_id = 0;
      27 [ +  - ][ +  - ]:         12 :             MBERRCHK(mb->tag_get_data(BLNodeIDTag, &qconn[i], 1, &node_tag_id) ,mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      28 [ +  - ][ +  - ]:         12 :             MBERRCHK(mb->get_coords(&qconn[i], 1, one_node_in_quad),mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      29 [ +  - ][ +  - ]:         12 :             m_LogFile << std::setprecision (3) << std::scientific << " new nodes:- coords: " << one_node_in_quad[0]
         [ +  - ][ +  - ]
                 [ +  - ]
      30 [ +  - ][ +  - ]:         12 :                       << ", " << one_node_in_quad[1] << ", " << one_node_in_quad[2]  << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
      31                 :            :             
      32                 :            :             //populate the connectivity after creating nodes for this BL node
      33         [ +  + ]:         36 :             for(int j=0; j< m_Intervals; j++){
      34                 :            :                 
      35 [ +  - ][ +  - ]:         24 :                 if(m_Conn == 8 && m_BElemNodes == 4){ // hex
      36                 :         24 :                     int nid = node_tag_id*m_Intervals + j;
      37         [ +  + ]:         24 :                     if(j == 0){
      38 [ +  - ][ +  - ]:         12 :                         conn[m_Conn*j +i] = qconn[i];
      39 [ +  - ][ +  - ]:         12 :                         conn[m_Conn*j + i+m_BElemNodes] = new_vert[nid];
      40                 :            :                       }
      41         [ +  - ]:         12 :                     else if(j==(m_Intervals-1)){
      42 [ +  - ][ +  - ]:         12 :                         conn[m_Conn*j +i] = new_vert[nid];
      43 [ +  - ][ +  - ]:         12 :                         conn[m_Conn*j + i+m_BElemNodes] = new_vert[nid -1];
      44                 :            :                       }
      45                 :            :                     else {
      46 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = new_vert[nid + m_Intervals - 2*j -1];
      47 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + i+m_BElemNodes] = new_vert[nid + m_Intervals - 2*j -2];
      48                 :         24 :                       }
      49                 :            :                   }
      50 [ #  # ][ #  # ]:          0 :                 else if(m_Conn == 4 && m_BElemNodes == 2){ // Quads
      51                 :          0 :                     int nid = node_tag_id*m_Intervals+j;
      52         [ #  # ]:          0 :                     if(m_Intervals == 1){
      53 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = new_vert[nid];
      54 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + i+m_BElemNodes] = qconn[m_BElemNodes-i-1];
      55                 :            :                       }
      56         [ #  # ]:          0 :                     else if(j==0){
      57 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = qconn[m_BElemNodes-i-1];
      58 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + i+m_BElemNodes] = new_vert[nid + m_Intervals - 2];
      59                 :            :                       }
      60         [ #  # ]:          0 :                     else if(j==(m_Intervals-1)){
      61 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = new_vert[nid];
      62 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + m_BElemNodes + 1 -i] = new_vert[nid - m_Intervals + 1];
      63                 :            :                       }
      64                 :            :                     else {
      65 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = new_vert[nid + m_Intervals - 2*j -2];
      66 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + m_BElemNodes + 1 -i] = new_vert[nid + m_Intervals - 2*j -1];
      67                 :          0 :                       }
      68                 :            :                   }
      69 [ #  # ][ #  # ]:          0 :                 else if(m_Conn == 4 && m_BElemNodes == 3){ // && hybrid == true make wedges aka prisms for tet mesh
      70                 :          0 :                     int nid = node_tag_id*m_Intervals+j;
      71         [ #  # ]:          0 :                     if(j==0){
      72 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = qconn[i];
      73 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + i+m_BElemNodes] = new_vert[nid];
      74                 :            :                       }
      75         [ #  # ]:          0 :                     else if(j==(m_Intervals-1)){
      76 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = new_vert[nid];
      77 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + i+m_BElemNodes] = new_vert[nid-1];
      78                 :            :                       }
      79                 :            :                     else {
      80 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = new_vert[nid + m_Intervals - 2*j -1];
      81 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + i+m_BElemNodes] = new_vert[nid + m_Intervals - 2*j -2];
      82                 :          0 :                       }
      83                 :            :                   }
      84 [ #  # ][ #  # ]:          0 :                 else if(m_Conn == 3 && m_BElemNodes == 2){ // make quads for tri mesh
      85                 :          0 :                     int nid = node_tag_id*m_Intervals+j;
      86         [ #  # ]:          0 :                     if(m_Intervals == 1){
      87 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j +i] = new_vert[nid];
      88 [ #  # ][ #  # ]:          0 :                         conn[m_Conn*j + i+m_BElemNodes] = qconn[m_BElemNodes-i-1];
      89                 :            :                       }
      90         [ #  # ]:          0 :                     else if(j==0){
      91 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = qconn[m_BElemNodes-i-1];
      92 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + i+m_BElemNodes] = new_vert[nid + m_Intervals - 2];
      93                 :            :                       }
      94         [ #  # ]:          0 :                     else if(j==(m_Intervals-1)){
      95 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = new_vert[nid];
      96 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + m_BElemNodes + 1 - i] = new_vert[nid - m_Intervals + 1];
      97                 :            :                       }
      98                 :            :                     else {
      99 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j +i] = new_vert[nid + m_Intervals - 2*j -2];
     100 [ #  # ][ #  # ]:          0 :                         conn[m_HConn*j + m_BElemNodes + 1 - i] = new_vert[nid + m_Intervals - 2*j -1];
     101                 :          0 :                       }
     102                 :            :                   }
     103                 :            :                 else {
     104 [ #  # ][ #  # ]:          0 :                     std::cout << "ERROR: cannot create BL elements: element type not supported." << std::endl;
     105                 :          0 :                     exit(0);
     106                 :            :                   }
     107                 :            :               }
     108                 :            :           }
     109                 :            :         
     110                 :            :         //TODO: Set Connectivity of tet's, break prisms into 3 tets, Another loop is required.
     111 [ -  + ][ #  # ]:          3 :         if(m_Conn == 4 && m_BElemNodes == 3 && hybrid == false){
                 [ #  # ]
     112         [ #  # ]:          0 :             for(int c=0; c<m_Intervals; c++){
     113                 :            :                 // first tet
     114 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3] =     conn[c*m_HConn + 0];
     115 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 1] = conn[c*m_HConn + 4];
     116 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 2] = conn[c*m_HConn + 5];
     117 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 3] = conn[c*m_HConn + 3];
     118                 :            :                 // middle tet
     119 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 4] = conn[c*m_HConn + 0];
     120 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 5] = conn[c*m_HConn + 1];
     121 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 6] = conn[c*m_HConn + 2];
     122 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 7] = conn[c*m_HConn + 5];
     123                 :            :                 //last tet
     124 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 8] = conn[c*m_HConn + 0];
     125 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 9] = conn[c*m_HConn + 1];
     126 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 10] = conn[c*m_HConn + 5];
     127 [ #  # ][ #  # ]:          0 :                 tet_conn[m_Conn*c*3 + 11] = conn[c*m_HConn + 4];
     128                 :            :               }
     129                 :            :           }
     130                 :            :         
     131 [ -  + ][ #  # ]:          3 :         if(m_Conn == 3 && m_BElemNodes == 2 && hybrid == false){
                 [ #  # ]
     132         [ #  # ]:          0 :             for(int c=0; c<m_Intervals; c++){
     133         [ #  # ]:          0 :                 if(tri_sch == 1){
     134                 :            :                     // lower triangle
     135 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2] =     conn[c*m_HConn + 0];
     136 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 1] = conn[c*m_HConn + 1];
     137 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 2] = conn[c*m_HConn + 2];
     138                 :            :                     // upper triangl
     139 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 3] = conn[c*m_HConn + 2];
     140 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 4] = conn[c*m_HConn + 3];
     141 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 5] = conn[c*m_HConn + 0];
     142                 :            :                   }
     143         [ #  # ]:          0 :                 else if(tri_sch == 2){
     144                 :            :                     // lower triangle
     145 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2] =     conn[c*m_HConn + 0];
     146 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 1] = conn[c*m_HConn + 1];
     147 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 2] = conn[c*m_HConn + 2];
     148                 :            :                     // upper triangle
     149 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 3] = conn[c*m_HConn + 2];
     150 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 4] = conn[c*m_HConn + 3];
     151 [ #  # ][ #  # ]:          0 :                     tri_conn[m_Conn*c*2 + 5] = conn[c*m_HConn + 0];
     152                 :            :                   }
     153                 :            :               }
     154                 :            :           }
     155                 :            :         
     156                 :            :         // create boundary layer hexes
     157                 :            :         // hex material will be found from the innermost hex adjacency. Let's create that first.       
     158         [ +  + ]:          9 :         for(int j=0; j < m_Intervals; j++){
     159         [ +  - ]:          6 :             if(m_Conn == 8){
     160 [ +  - ][ +  - ]:          6 :                 MBERRCHK(mb->create_element(moab::MBHEX, &conn[j*m_Conn], m_Conn, hex),mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     161                 :            :               }
     162 [ #  # ][ #  # ]:          0 :             else if(m_Conn==4 && m_GD ==3 && hybrid == true){
                 [ #  # ]
     163 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBPRISM, &conn[j*6], 6, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     164                 :            :               }
     165 [ #  # ][ #  # ]:          0 :             else if(m_Conn==4 && m_GD ==2){
     166 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBQUAD, &conn[j*m_Conn], m_Conn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     167                 :            :               }
     168 [ #  # ][ #  # ]:          0 :             else if(m_Conn==3 && m_GD ==2 && hybrid == true){
                 [ #  # ]
     169 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBQUAD, &conn[j*m_HConn], m_HConn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     170                 :            :               }
     171 [ #  # ][ #  # ]:          0 :             else if(m_Conn==3 && m_GD ==2 && hybrid == false){
                 [ #  # ]
     172 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBTRI, &tri_conn[j*m_Conn*2], m_Conn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     173 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBTRI, &tri_conn[j*m_Conn*2+3], m_Conn, hex1),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     174                 :            :                 //       MBERRCHK(mb->add_entities(mthis_set, &hex1, 1), mb);
     175                 :            :                 //        MBERRCHK(mb->add_entities(smooth_set, &hex1, 1), mb);
     176                 :            :               }
     177 [ #  # ][ #  # ]:          0 :             else if(m_Conn==4 && m_GD ==3 && hybrid == false){
                 [ #  # ]
     178 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3], m_Conn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     179 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3+4], m_Conn, hex1),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     180 [ #  # ][ #  # ]:          0 :                 MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3+8], m_Conn, hex2),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     181                 :            :                 //       MBERRCHK(mb->add_entities(mthis_set, &hex1, 1), mb);
     182                 :            :                 //        MBERRCHK(mb->add_entities(smooth_set, &hex1, 1), mb);
     183                 :            :               }
     184                 :            :             
     185         [ +  - ]:          6 :             vw.quality_measure(hex, MB_JACOBIAN, jac);
     186         [ +  + ]:          6 :             if(jac < 0){
     187 [ +  - ][ +  - ]:          3 :                 m_LogFile <<  "New BL elements have negative jacobian, trying to fix.. " << jac << std::endl;
                 [ +  - ]
     188                 :            :                 // swap 0-4 1-5 2-6 3-7 for positive jacobian -> posibly a multi material case
     189                 :            :                 moab::EntityHandle temp;
     190         [ +  + ]:         15 :                 for(int ii = j*m_Conn; ii < j*m_Conn + m_BElemNodes; ii++){
     191         [ +  - ]:         12 :                     temp = conn[ii];
     192 [ +  - ][ +  - ]:         12 :                     conn[ii] = conn[ii+m_BElemNodes];
     193         [ +  - ]:         12 :                     conn[ii+m_BElemNodes] = temp;
     194                 :            :                   }
     195                 :            :                 
     196                 :            :                 //reverse the tet connectivity based on the prism reverse
     197 [ -  + ][ #  # ]:          3 :                 if(m_Conn == 4 && m_BElemNodes == 3 && hybrid == false){
                 [ #  # ]
     198         [ #  # ]:          0 :                     for(int c=0; c<m_Intervals; c++){
     199                 :            :                         // first tet
     200 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3] =     conn[c*m_HConn + 0];
     201 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 1] = conn[c*m_HConn + 4];
     202 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 2] = conn[c*m_HConn + 5];
     203 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 3] = conn[c*m_HConn + 3];
     204                 :            :                         // middle tet
     205 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 4] = conn[c*m_HConn + 0];
     206 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 5] = conn[c*m_HConn + 1];
     207 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 6] = conn[c*m_HConn + 2];
     208 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 7] = conn[c*m_HConn + 5];
     209                 :            :                         //last tet
     210 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 8] = conn[c*m_HConn + 0];
     211 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 9] = conn[c*m_HConn + 1];
     212 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 10] = conn[c*m_HConn + 5];
     213 [ #  # ][ #  # ]:          0 :                         tet_conn[m_Conn*c*3 + 11] = conn[c*m_HConn + 4];
     214                 :            :                       }
     215                 :            :                   }
     216                 :            :                 
     217                 :            :                 // recreate this element 
     218         [ +  - ]:          3 :                 if(m_Conn == 8){
     219 [ +  - ][ +  - ]:          3 :                     MBERRCHK(mb->create_element(moab::MBHEX, &conn[j*m_Conn], m_Conn, hex),mb);
         [ -  + ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     220                 :            :                   }
     221 [ #  # ][ #  # ]:          0 :                 else if(m_Conn==4 && m_GD ==3 && hybrid == false){
                 [ #  # ]
     222 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3], m_Conn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     223 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3+4], m_Conn, hex1),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     224 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBTET, &tet_conn[j*m_Conn*3+8], m_Conn, hex2),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     225                 :            :                   }
     226 [ #  # ][ #  # ]:          0 :                 else if(m_Conn==4 && m_GD ==3 && hybrid == true){
                 [ #  # ]
     227 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBPRISM, &conn[j*6], 6, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     228                 :            :                   }
     229 [ #  # ][ #  # ]:          0 :                 else if(m_Conn==4 && m_GD ==2){
     230 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBQUAD, &conn[j*m_Conn], m_Conn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     231                 :            :                   }
     232 [ #  # ][ #  # ]:          0 :                 else if(m_Conn==3 && m_GD ==2 && hybrid == true){
                 [ #  # ]
     233 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->create_element(MBQUAD, &conn[j*m_HConn], m_HConn, hex),mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     234                 :            :                   }
     235                 :            :                 // check jacobian again
     236         [ +  - ]:          3 :                 vw.quality_measure(hex, MB_JACOBIAN, jac);              
     237         [ -  + ]:          3 :                 if(jac < 0){
     238 [ #  # ][ #  # ]:          3 :                     m_LogFile << "Negative jacobian still found for the Bl elements, invalid mesh!"  << jac << std::endl;
                 [ #  # ]
     239                 :            :                   }      
     240                 :            :                 // end recreation of element -> negative hex was encontered while creating Bl elements
     241                 :            :               }
     242                 :            :             
     243         [ -  + ]:          6 :             if(mthis_set == 0){ // No material specified for BL hexes find the material to append the hex             
     244                 :          0 :                 moab::EntityHandle mat_set = 0;
     245 [ #  # ][ #  # ]:          0 :                 for (set_it = m_sets.begin(); set_it != m_sets.end(); set_it++)  {
         [ #  # ][ #  # ]
                 [ #  # ]
     246                 :          0 :                     int set_id = -1;
     247         [ #  # ]:          0 :                     mat_set = *set_it;
     248 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->tag_get_data(MTag, &mat_set, 1, &set_id), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     249 [ #  # ][ #  # ]:          0 :                     if(set_id == blmaterial_id[qcount -1])
     250                 :          0 :                       break;
     251                 :            :                   }
     252         [ #  # ]:          0 :                 if(mat_set != 0){
     253         [ #  # ]:          0 :                     if(hex!=0)
     254 [ #  # ][ #  # ]:          0 :                       MBERRCHK(mb->add_entities(mat_set,&hex,1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     255         [ #  # ]:          0 :                     if(hex1!=0)
     256 [ #  # ][ #  # ]:          0 :                       MBERRCHK(mb->add_entities(mat_set,&hex1,1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     257         [ #  # ]:          0 :                     if(hex2!=0)
     258 [ #  # ][ #  # ]:          0 :                       MBERRCHK(mb->add_entities(mat_set,&hex2,1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     259                 :            :                   }
     260                 :            :                 else{
     261                 :          0 :                     exit(0);
     262                 :            :                   }
     263                 :            :               }
     264                 :            :             else {
     265 [ +  - ][ -  + ]:          6 :                 MBERRCHK(mb->add_entities(mthis_set, &hex, 1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     266 [ -  + ][ #  # ]:          6 :                 if(m_Conn==3 && m_GD ==2 && hybrid == false)
                 [ #  # ]
     267 [ #  # ][ #  # ]:          0 :                   MBERRCHK(mb->add_entities(mthis_set, &hex1, 1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     268 [ -  + ][ #  # ]:          6 :                 if(m_Conn==4 && m_GD ==3 && hybrid == false){
                 [ #  # ]
     269 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->add_entities(mthis_set, &hex1, 1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     270 [ #  # ][ #  # ]:          0 :                     MBERRCHK(mb->add_entities(mthis_set, &hex2, 1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     271                 :            :                   }
     272                 :            :               }
     273                 :            :             // mark entities for smoothing - careful: smoothing BL elements will cause loss of biased elements
     274                 :            :             //                MBERRCHK(mb->add_entities(smooth_set, &hex, 1), mb);
     275                 :            :             // add geom dim tag
     276 [ +  - ][ -  + ]:          6 :             MBERRCHK(mb->add_entities(geom_set, &hex, 1), mb);
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     277                 :            :             //              // TODO: Add Local Smooting
     278                 :            :           }
     279                 :          3 :       }
     280                 :            :     //    all_elems.clear();
     281                 :            :     //    moab::Range skin_verts;
     282                 :            :     //    MBERRCHK(mb->get_entities_by_dimension(0, 3, all_elems,true),mb);
     283                 :            :     //    moab::Skinner skinner(mb);
     284                 :            :     //    skinner.find_skin(0, all_elems, 0, skin_verts);
     285                 :            :     //    m_LogFile << "setting 'fixed'' tag = 1 on verts in the skin = " <<  skin_verts.size() << std::endl;
     286                 :            :     //    // set fixed tag = 1 on all skin verts
     287                 :            :     //    std::vector<int> all_skin_data(skin_verts.size(), 1);
     288                 :            :     //    MBERRCHK(mb->tag_set_data(FTag, skin_verts, &all_skin_data[0]), mb);
     289                 :          1 :     return 0;
     290                 :            :   }
     291 [ +  - ][ +  - ]:        156 : }

Generated by: LCOV version 1.11