LCOV - code coverage report
Current view: top level - algs/AssyGen - meshscript.cpp (source / functions) Hit Total Coverage
Test: coverage_sk.info Lines: 188 502 37.5 %
Date: 2020-07-01 15:24:36 Functions: 3 3 100.0 %
Branches: 466 2648 17.6 %

           Branch data     Line data    Source code
       1                 :            : 
       2                 :            : #include "meshkit/AssyGen.hpp"
       3                 :            : 
       4                 :            : namespace MeshKit
       5                 :            : {
       6                 :          1 :   void AssyGen::CreateCubitJournal()
       7                 :            :   //---------------------------------------------------------------------------
       8                 :            :   //Function: Create Cubit Journal File for generating mesh
       9                 :            :   //Input:    none
      10                 :            :   //Output:   none
      11                 :            :   //---------------------------------------------------------------------------
      12                 :            :   {
      13                 :            : #ifdef HAVE_RGG16
      14                 :            :     m_FileOutput << "#RGG16 enabled for AssyGen" << std::endl;
      15                 :            : #else
      16 [ +  - ][ +  - ]:          1 :     m_FileOutput << "#<15.1 version enabled for AssyGen" << std::endl;
      17                 :            : #endif
      18 [ +  - ][ -  + ]:          1 :     if(m_szMeshScheme == "hole")
      19 [ #  # ][ #  # ]:          0 :       m_FileOutput << "surf in group hole_surfaces scheme hole" << std::endl;
      20                 :            : 
      21         [ -  + ]:          1 :     if (m_nBLAssemblyMat !=0){
      22                 :            :         // Also look for material name in BL material list
      23         [ #  # ]:          0 :         for (int ll=1; ll<= m_nBLAssemblyMat; ll++){
      24                 :            :             //if(szVCylMat(m) == m_szBLAssmMat(ll)) {
      25                 :            : #ifdef HAVE_RGG16
      26                 :            :             m_FileOutput << "group 'tmpgrp' equals surf with name '" <<  m_szBLAssmMat(ll)  << "_top*'" << std::endl;
      27                 :            : #else
      28 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'tmpgrp' equals surf with name '" <<  m_szBLAssmMat(ll)  << "_top'" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
      29                 :            : #endif
      30                 :            : 
      31 [ #  # ][ #  # ]:          0 :             m_FileOutput << "surf in tmpgrp size {RADIAL_MESH_SIZE}" << std::endl;
      32 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group '" << m_szBLAssmMat(ll) << "_hole_surfaces' equals surf in tmpgrp"<< std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
      33 [ #  # ][ #  # ]:          0 :             m_FileOutput << "surface in group " << m_szBLAssmMat(ll) << "_hole_surfaces scheme hole rad_interval " << m_nBLMatIntervals(ll) << " bias " << m_dBLMatBias(ll) << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      34         [ #  # ]:          0 :             if(strcmp(m_szSmooth.c_str(),"on") == 0)
      35 [ #  # ][ #  # ]:          0 :               m_FileOutput << "surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces" << " smooth scheme condition number beta 2.0 cpu 10" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
      36                 :            :             //         m_FileOutput << "mesh surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces" << std::endl;
      37                 :            :             // }
      38 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'bl_surfaces' add surf in tmpgrp" << std::endl;
      39                 :            :           }
      40                 :            :       }
      41                 :            :     // variables
      42                 :            :     int nColor;
      43                 :            :     std::string color[21] = {" ", "thistle", "grey", "deepskyblue", "red", "purple",  "green",
      44                 :            :                              "yellow", "royalblue", "magenta", "cyan", "lightsalmon", "springgreen",
      45 [ +  - ][ +  - ]:         22 :                              "gold", "orange", "brown", "pink", "khaki", "black", "aquamarine", "mediumslateblue"};
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
           [ #  #  #  # ]
      46                 :            : 
      47                 :            :     // if creating only journal file load the geometry file to compute bounding box for automatic size specification
      48         [ -  + ]:          1 :     if(m_nJouFlag == 1){
      49                 :            : #if defined (HAVE_ACIS) || defined (HAVE_OCC)
      50 [ #  # ][ #  # ]:          0 :         iGeom_load(igeomImpl->instance(), m_szGeomFile.c_str(), NULL, &err, m_szGeomFile.length() , 0);
      51                 :            : #endif
      52                 :            :       }
      53                 :            : 
      54                 :            :     // get the max and min coordinates of the geometry
      55                 :            : #if defined (HAVE_ACIS) || defined (HAVE_OCC)
      56                 :            :     double x1, y1, z1, x2, y2, z2;
      57 [ +  - ][ +  - ]:          1 :     iGeom_getBoundBox( igeomImpl->instance(), &x1, &y1, &z1, &x2, &y2, &z2, &err );
      58                 :            : #endif
      59                 :            : 
      60                 :          1 :     int nSideset=m_nNeumannSetId;
      61                 :            : 
      62 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "group \"gall\" add vol all\n#{gtempid = Id(\"group\")}\n" << std::endl;
      63 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{Zmax = BBox_ZMax(\"group\", gtempid)}" << std::endl;
      64 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{Zmin = BBox_ZMin(\"group\", gtempid)}" << std::endl;
      65                 :            : 
      66 [ +  - ][ +  - ]:          2 :     std::string szGrp, szBlock, szSurfTop, szSurfBot, szSize, szSurfSide;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
      67                 :          1 :     double dHeight = 0.0, dMid = 0.0;
      68                 :          1 :     int nTemp = 1;
      69                 :            : #if defined (HAVE_ACIS) || defined (HAVE_OCC)
      70         [ +  - ]:          1 :     if(m_nDimensions > 0){
      71                 :          1 :         dHeight= fabs(z2 - z1);
      72                 :          1 :         dMid = z2 - dHeight/2.0;
      73                 :            :       }
      74                 :            : #endif
      75                 :            : 
      76                 :            :     // writing to template.jou
      77         [ +  - ]:          1 :     m_SchemesFile << "## This file is created by rgg program in MeshKit ##\n";
      78 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "##Schemes " << std::endl  ;
      79 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{CIRCLE =\"circle interval 1 fraction 0.8\"}" << std::endl;
      80 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{HOLE = \"hole rad_interval 2 bias 0.0\"}" << std::endl;
      81 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{PAVE = \"pave\"}" << std::endl;
      82 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{MAP = \"map\"}" << std::endl;
      83 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{SWEEP = \"sweep\"}" << std::endl;
      84 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{TET = \"tetmesh\"}" << std::endl;
      85 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "#{TOP_EDGE_INTERVAL = " << m_edgeInterval << " }" << std::endl;
         [ +  - ][ +  - ]
      86 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "## Dimensions" << std::endl;
      87 [ +  - ][ -  + ]:          1 :     if(m_szGeomType == "hexagonal"){
      88         [ #  # ]:          0 :         if(m_nDimensions > 0){
      89 [ #  # ][ #  # ]:          0 :             m_SchemesFile << "#{PITCH =" << m_dMAssmPitch(nTemp, m_nDimensions) << "}" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
      90                 :            :           }
      91                 :            :       }
      92 [ +  - ][ +  - ]:          1 :     else if(m_szGeomType == "rectangular"){
      93         [ +  - ]:          1 :         if(m_nDimensions > 0){
      94 [ +  - ][ +  - ]:          1 :             m_SchemesFile << "#{PITCHX =" << m_dMAssmPitchX(nTemp, m_nDimensions)<< "}" << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
      95 [ +  - ][ +  - ]:          1 :             m_SchemesFile << "#{PITCHY =" << m_dMAssmPitchY(nTemp, m_nDimensions) << "}" << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
      96                 :            :           }
      97                 :            :       }
      98         [ +  - ]:          1 :     if( m_nPlanar ==0){
      99 [ +  - ][ +  - ]:          1 :         m_SchemesFile << "#{Z_HEIGHT = Zmax - Zmin}" << std::endl;
     100 [ +  - ][ +  - ]:          1 :         m_SchemesFile << "#{Z_MID = (Zmax + Zmin)/2.0}" << std::endl;
     101                 :            :       }
     102 [ +  - ][ +  - ]:          1 :     m_SchemesFile << "##Set Mesh Sizes" << std::endl;
     103                 :            : 
     104 [ +  - ][ -  + ]:          1 :     if (m_szMeshType == "hex"){
     105                 :            :         // volume only
     106         [ #  # ]:          0 :         if(m_nPlanar == 0 ){
     107 [ #  # ][ #  # ]:          0 :             if (m_dAxialSize.GetSize() == 0){
     108 [ #  # ][ #  # ]:          0 :                 m_SchemesFile << "#{AXIAL_MESH_SIZE = 0.1*Z_HEIGHT}" << std::endl;
     109                 :            :               }
     110                 :            :             else {
     111 [ #  # ][ #  # ]:          0 :                 m_SchemesFile << "#{AXIAL_MESH_SIZE = " << m_dAxialSize(1) << "}" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     112                 :            :               }
     113                 :            : 
     114                 :            :             // create templates for specifying block z intervals
     115         [ #  # ]:          0 :             if (m_nDuct > 1){
     116 [ #  # ][ #  # ]:          0 :                 m_SchemesFile << "## Set interval along Z direction ## " << std::endl;
     117                 :            : 
     118         [ #  # ]:          0 :                 for( int p=1; p<= m_nDuct; p++){
     119 [ #  # ][ #  # ]:          0 :                     if (m_dAxialSize.GetSize() != 0)
     120 [ #  # ][ #  # ]:          0 :                       m_SchemesFile << "#{AXIAL_MESH_SIZE" << p << "=" << m_dAxialSize(p) << "}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     121                 :            :                     else
     122 [ #  # ][ #  # ]:          0 :                       m_SchemesFile << "#{AXIAL_MESH_SIZE" << p << "= 0.1*Z_HEIGHT}" << std::endl;
         [ #  # ][ #  # ]
     123 [ #  # ][ #  # ]:          0 :                     m_SchemesFile << "#{BLOCK" << p << "_Z_INTERVAL = AXIAL_MESH_SIZE" << p << "}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     124 [ #  # ][ #  # ]:          0 :                     m_SchemesFile << "#{BLOCK" << p << "_ZBOT = " << m_dMZAssm(p, 1) << "}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     125 [ #  # ][ #  # ]:          0 :                     m_SchemesFile << "#{BLOCK" << p << "_ZTOP = " << m_dMZAssm(p, 2) << "}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     126                 :            :                   }
     127 [ #  # ][ #  # ]:          0 :                 m_SchemesFile << "##" << std::endl;
     128                 :            :               }
     129                 :            :           }
     130         [ #  # ]:          0 :         if (-1.0 == m_dRadialSize) {
     131 [ #  # ][ #  # ]:          0 :             if (m_szGeomType == "hexagonal")
     132 [ #  # ][ #  # ]:          0 :               m_SchemesFile << "#{RADIAL_MESH_SIZE = 0.1*PITCH}" << std::endl;
     133                 :            :             else
     134 [ #  # ][ #  # ]:          0 :               m_SchemesFile << "#{RADIAL_MESH_SIZE = 0.02*0.5*(PITCHX+PITCHY)}" << std::endl;
     135                 :            :           }
     136                 :            :         else
     137 [ #  # ][ #  # ]:          0 :           m_SchemesFile << "#{RADIAL_MESH_SIZE = " << m_dRadialSize << "}" << std::endl;
         [ #  # ][ #  # ]
     138                 :            :       }
     139 [ +  - ][ +  - ]:          1 :     else if (m_szMeshType == "tet"){
     140         [ -  + ]:          1 :         if (-1.0 == m_dTetMeshSize) {
     141 [ #  # ][ #  # ]:          0 :             if (m_szGeomType == "hexagonal")
     142 [ #  # ][ #  # ]:          0 :               m_SchemesFile << "#{TET_MESH_SIZE = 0.1*PITCH}" << std::endl;
     143                 :            :             else
     144 [ #  # ][ #  # ]:          0 :               m_SchemesFile << "#{TET_MESH_SIZE = 0.02*0.5*(PITCHX+PITCHY)}" << std::endl;
     145                 :            :           }
     146                 :            :         else {
     147 [ +  - ][ +  - ]:          1 :             m_SchemesFile << "#{TET_MESH_SIZE = " << m_dTetMeshSize  << "}" << std::endl;
         [ +  - ][ +  - ]
     148                 :            :           }
     149                 :            :       }
     150                 :            : 
     151         [ +  - ]:          1 :     if(m_nHblock == -1){ // if more blocks are needed axially, create'em using hexes and the end
     152                 :            :         // block creation dumps
     153 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#Creating blocks, Note: you might need to combine some blocks" << std::endl;
     154                 :            :         // group creation dumps. each material has a group
     155 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#Creating groups" << std::endl;
     156 [ +  - ][ +  + ]:          4 :         for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     157 [ +  - ][ +  - ]:          3 :             szGrp = "g_"+ m_szAssmMat(p);
                 [ +  - ]
     158         [ +  - ]:          3 :             m_szAssmMat(p);
     159         [ -  + ]:          3 :             if(m_nPlanar ==1){
     160                 :            : #ifdef HAVE_RGG16
     161                 :            :                 m_FileOutput << "group \"" << szGrp << "\" add surface with name \"" << m_szAssmMat(p) <<"*\"" << std::endl;
     162                 :            : #else
     163 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group \"" << szGrp << "\" add surface with name \"" << m_szAssmMat(p) <<"\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     164                 :            : #endif
     165                 :            :               }
     166                 :            :             else{
     167                 :            : #ifdef HAVE_RGG16              
     168                 :            :                 m_FileOutput << "group \"" << szGrp << "\" add body with name \"" << m_szAssmMat(p) <<"*\"" << std::endl;
     169                 :            : #else
     170 [ +  - ][ +  - ]:          3 :                 m_FileOutput << "group \"" << szGrp << "\" add body with name \"" << m_szAssmMat(p) <<"\"" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
                 [ +  - ]
     171                 :            : #endif
     172                 :            :               }
     173                 :            :           }
     174 [ +  - ][ +  + ]:          4 :         for(int p = 1; p <=  (m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     175 [ +  - ][ +  - ]:          3 :             szBlock = "b_"+ m_szAssmMat(p);
                 [ +  - ]
     176 [ +  - ][ +  - ]:          3 :             szGrp = "g_"+ m_szAssmMat(p);
                 [ +  - ]
     177 [ +  - ][ +  - ]:          3 :             m_FileOutput << "#{nb" << p << " =NumInGrp('" << szGrp << "')}" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     178 [ +  - ][ +  - ]:          3 :             m_FileOutput << "#{Ifndef(nb" << p << ")}" << "\n" << "#{else}" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     179         [ -  + ]:          3 :             if(m_nPlanar ==1){
     180 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "block " << m_nMaterialSetId + p -1 << " surface in " << szGrp  << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     181 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "block " << m_nMaterialSetId + p -1 << " name \"" << szBlock <<"\""<< std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     182                 :            :               }
     183                 :            :             else{
     184 [ +  - ][ +  - ]:          3 :                 m_FileOutput << "block " << m_nMaterialSetId + p -1 << " body in " << szGrp  << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
     185 [ +  - ][ +  - ]:          3 :                 m_FileOutput << "block " << m_nMaterialSetId + p -1 << " name \"" << szBlock <<"\""<< std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     186                 :            :               }
     187 [ +  - ][ +  - ]:          3 :             m_FileOutput << "#{endif}" << std::endl;
     188                 :            :           }
     189 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#" << std::endl;
     190                 :            :       }
     191 [ +  - ][ -  + ]:          1 :     if(m_szMeshType == "hex"){
     192                 :            :         // imprint
     193 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Imprint geometry" << std::endl;
     194 [ #  # ][ #  # ]:          0 :         m_FileOutput << "imprint all" << std::endl;
     195 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     196                 :            :         // merge
     197                 :            : 
     198 [ #  # ][ #  # ]:          0 :         m_FileOutput << "Merge Tolerance " << m_dMergeTol << std::endl;
                 [ #  # ]
     199 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     200                 :            : 
     201 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Merge geometry" << std::endl;
     202 [ #  # ][ #  # ]:          0 :         m_FileOutput << "merge all" << std::endl;
     203 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     204                 :            :       }
     205                 :            : 
     206                 :            :     // for info keyword
     207         [ +  - ]:          1 :     if(strcmp(m_szInfo.c_str(),"on") == 0){
     208                 :          1 :         int temp = 9700;
     209 [ +  - ][ +  - ]:          1 :         m_FileOutput << "# stuff for info keyword, remove if not desired " << std::endl;
     210 [ +  - ][ +  - ]:          1 :         m_FileOutput << "# putting pins in seperate blocks " << std::endl;
     211 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#" << std::endl;
     212         [ +  + ]:          3 :         for (int i=0; i<m_nTotalPincells; i++){
     213 [ +  - ][ +  - ]:          2 :             m_FileOutput << "#You might have to use:\n#set duplicate block elements on\n#This is required for creating blocks with pin materials only" << std::endl;
     214                 :            : #ifdef HAVE_RGG16
     215                 :            :             m_FileOutput << "group 'g"<< i+m_nStartpinid << "' add body with name '*_xp" << i+m_nStartpinid << "_*'" << std::endl;
     216                 :            : #else
     217 [ +  - ][ +  - ]:          2 :             m_FileOutput << "group 'g"<< i+m_nStartpinid << "' add body with name '_xp" << i+m_nStartpinid << "_'" << std::endl;            
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     218                 :            : #endif
     219 [ +  - ][ +  - ]:          2 :             m_FileOutput << "#{nbody" << i+1 << " =NumInGrp('g" <<i+m_nStartpinid << "')}" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     220 [ +  - ][ +  - ]:          2 :             m_FileOutput << "#{Ifndef(nbody" << i+1 << ")}" << "\n" << "#{else}" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     221 [ +  - ][ +  - ]:          2 :             m_FileOutput << "block " << temp+i << " body in group g" << i+m_nStartpinid << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
     222 [ +  - ][ +  - ]:          2 :             m_FileOutput << "block " << temp+i << " name '_xp" << i+m_nStartpinid << "'" << std::endl;
         [ +  - ][ +  - ]
         [ +  - ][ +  - ]
     223 [ +  - ][ +  - ]:          2 :             m_FileOutput << "#{endif}" << std::endl;
     224                 :            :           }
     225                 :            :       }
     226                 :            : 
     227                 :            :     //surface only
     228         [ -  + ]:          1 :     if(m_nPlanar ==1){
     229 [ #  # ][ #  # ]:          0 :         m_FileOutput << "# Pointing surface normals to 0.0, 0.0, -1.0 or -ve Z or correct STARCCM+ cell-face orientation" << std::endl;
     230 [ #  # ][ #  # ]:          0 :         m_FileOutput << "surface all normal opposite" << std::endl;
     231 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     232                 :            :       }
     233                 :            :     // volume only
     234                 :            :     else{
     235 [ +  - ][ -  + ]:          1 :         if(m_szSideset == "yes"){
     236                 :            : 
     237                 :            :             // rename the skin surfaces, so that they don't appear as sidesets
     238         [ #  # ]:          0 :             for (int p=1; p<=m_nDuct; p++){
     239         [ #  # ]:          0 :                 for(int q=1;q<=m_nSides; q++){
     240                 :            : #ifdef HAVE_RGG16
     241                 :            :                     m_FileOutput << "group 'edge" << (m_nSides*(p-1) + q ) <<"' equals curve with name 'side_edge"
     242                 :            :                                  << (m_nSides*(p-1) + q ) << "*'" << std::endl;
     243                 :            : #else
     244 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group 'edge" << (m_nSides*(p-1) + q ) <<"' equals curve with name 'side_edge"
                 [ #  # ]
     245 [ #  # ][ #  # ]:          0 :                                  << (m_nSides*(p-1) + q ) << "@'" << std::endl;
                 [ #  # ]
     246                 :            : #endif
     247                 :            : 
     248                 :            : 
     249 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group 'vt" <<  (m_nSides*(p-1) + q )  <<"' equals vertex with z_max == z_min in curve in edge"
                 [ #  # ]
     250 [ #  # ][ #  # ]:          0 :                                  <<  (m_nSides*(p-1) + q ) << std::endl;
     251                 :            : 
     252                 :            :                   }
     253                 :            :               }
     254                 :            : 
     255                 :            :             // creating groups for vertices on the top surface of the duct
     256         [ #  # ]:          0 :             for (int p=1; p<=m_nDuct; p++){
     257         [ #  # ]:          0 :                 for(int q=1;q<=m_nSides; q++){
     258                 :            : 
     259         [ #  # ]:          0 :                     if(q != m_nSides){
     260 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'v" << (m_nSides*(p-1) + q ) <<"' intersect group vt" << (m_nSides*(p-1) + q )
         [ #  # ][ #  # ]
     261 [ #  # ][ #  # ]:          0 :                                      << " with group vt" <<  (m_nSides*(p-1) + q + 1 )  << std::endl;
                 [ #  # ]
     262                 :            :                       }
     263                 :            :                     else {
     264 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'v" << (m_nSides*(p-1) + q ) <<"' intersect group vt" << (m_nSides*(p-1) + q )
         [ #  # ][ #  # ]
     265 [ #  # ][ #  # ]:          0 :                                      << " with group vt" <<  (m_nSides*(p-1) + 1 )  << std::endl;
                 [ #  # ]
     266                 :            :                       }
     267                 :            :                   }
     268                 :            :               }
     269                 :            :             // creating temp surfaces groups
     270         [ #  # ]:          0 :             for (int p=1; p<=m_nDuct; p++){
     271         [ #  # ]:          0 :                 for(int q=1;q<=m_nSides; q++){
     272 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group 'st" << (m_nSides*(p-1) + q ) <<"' equals surface with z_max <> z_min in vert in v"
                 [ #  # ]
     273 [ #  # ][ #  # ]:          0 :                                  << (m_nSides*(p-1) + q ) << "'" << std::endl;
                 [ #  # ]
     274                 :            :                   }
     275                 :            :               }
     276                 :            : 
     277                 :            :             // creating surface groups for obtaining surfaces
     278         [ #  # ]:          0 :             for (int p=1; p<=m_nDuct; p++){
     279         [ #  # ]:          0 :                 for(int q=1;q<=m_nSides; q++){
     280         [ #  # ]:          0 :                     if(q != 1){
     281 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 's" << (m_nSides*(p-1) + q ) <<"' intersect group st"  << (m_nSides*(p-1) + q )
         [ #  # ][ #  # ]
     282 [ #  # ][ #  # ]:          0 :                                      << " with group st" <<  (m_nSides*(p-1) + q - 1 )  << std::endl;
                 [ #  # ]
     283                 :            :                       }
     284                 :            :                     else {
     285 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 's" << (m_nSides*(p-1) + q ) <<"' intersect group st" << (m_nSides*(p-1) + q )
         [ #  # ][ #  # ]
     286 [ #  # ][ #  # ]:          0 :                                      << " with group st" <<  (m_nSides*(p-1) + m_nSides )  << std::endl;
                 [ #  # ]
     287                 :            :                       }
     288                 :            :                   }
     289                 :            :               }
     290                 :            : 
     291                 :            :             // renaming the skin side surfaces
     292         [ #  # ]:          0 :             for (int p=1; p<=m_nDuct; p++){
     293         [ #  # ]:          0 :                 for(int q=1;q<=m_nSides; q++){
     294 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "surface in group s" <<  (m_nSides*(p-1) + q ) << " rename 'side_surface"
                 [ #  # ]
     295 [ #  # ][ #  # ]:          0 :                                  <<  (m_nSides*(p-1) + q ) << "'" << std::endl;
                 [ #  # ]
     296                 :            : 
     297                 :            :                   }
     298                 :            :               }
     299                 :            :           }
     300                 :            : 
     301 [ +  - ][ -  + ]:          1 :         if(m_szMeshType == "hex"){
     302                 :            : 
     303                 :            :             //now set the sizes
     304 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#Set Meshing Scheme and Sizes, use template.jou to specify sizes" << std::endl;
     305                 :            : 
     306 [ #  # ][ #  # ]:          0 :             for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     307 [ #  # ][ #  # ]:          0 :                 szGrp = "g_"+ m_szAssmMat(p);
                 [ #  # ]
     308 [ #  # ][ #  # ]:          0 :                 szSize =  m_szAssmMat(p) + "_size";
                 [ #  # ]
     309 [ #  # ][ #  # ]:          0 :                 szSurfBot = m_szAssmMat(p) + "_bot";
                 [ #  # ]
     310 [ #  # ][ #  # ]:          0 :                 szSize =  m_szAssmMat(p) + "_surf_size";
                 [ #  # ]
     311                 :            : #ifdef HAVE_RGG16
     312                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfBot  << "*\"" << std::endl;
     313                 :            : #else
     314 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfBot  << "\"" << std::endl;
         [ #  # ][ #  # ]
     315                 :            : #endif
     316 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     317                 :            :               }
     318 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#" << std::endl;
     319                 :            :           }
     320                 :            :       }
     321 [ +  - ][ -  + ]:          1 :     if(m_szMeshType == "hex"){
     322                 :            :         // some more common stuff meshing top surfaces set the sizes and mesh
     323 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Surfaces mesh, use template.jou to specify sizes" << std::endl;
     324 [ #  # ][ #  # ]:          0 :         for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     325 [ #  # ][ #  # ]:          0 :             szSurfTop = m_szAssmMat(p) + "_top";
                 [ #  # ]
     326 [ #  # ][ #  # ]:          0 :             szGrp = "g_"+ m_szAssmMat(p);
                 [ #  # ]
     327 [ #  # ][ #  # ]:          0 :             szSize =  m_szAssmMat(p) + "_surf_size";
                 [ #  # ]
     328 [ #  # ][ #  # ]:          0 :             if(m_szMeshScheme == "hole" && m_nBLAssemblyMat == 0){
         [ #  # ][ #  # ]
     329                 :            : #ifdef HAVE_RGG16
     330                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "*\"" << std::endl;
     331                 :            : #else
     332 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "\"" << std::endl;
         [ #  # ][ #  # ]
     333                 :            : #endif
     334 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'remove_hole' intersect group tmpgrp with group hole_surfaces" << std::endl;
     335 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{nIntersect=NumInGrp('remove_hole')}" << std::endl;
     336 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{If(nIntersect==0)}" << std::endl;
     337 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     338 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp scheme {" << "PAVE" << "}"  << std::endl;
         [ #  # ][ #  # ]
     339 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{endif}"  << std::endl;
     340                 :            :               }
     341                 :            :             else{
     342                 :            : #ifdef HAVE_RGG16
     343                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "*\"" << std::endl;
     344                 :            : #else
     345 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "\"" << std::endl;
         [ #  # ][ #  # ]
     346                 :            : #endif
     347 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     348 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp scheme {" << "PAVE" << "}"  << std::endl;
         [ #  # ][ #  # ]
     349                 :            :               }
     350                 :            : 
     351 [ #  # ][ #  # ]:          0 :             if (p==1 && m_edgeInterval != 99){
     352                 :            : #ifdef HAVE_RGG16
     353                 :            :                 m_FileOutput << "group 'sz_edges" <<"' equals curve with name 'side_edge*'"<< std::endl;
     354                 :            : #else
     355 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'sz_edges" <<"' equals curve with name 'side_edge'"<< std::endl;
                 [ #  # ]
     356                 :            : #endif
     357 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "curve in sz_edges interval {TOP_EDGE_INTERVAL}" << std::endl;
     358                 :            :               }
     359                 :            : 
     360                 :            :             //    m_FileOutput << "mesh surface in " << szGrp << "\n#" << std::endl;
     361                 :            : 
     362                 :            :             // dumping these sizes schemes.jou also
     363 [ #  # ][ #  # ]:          0 :             m_SchemesFile << "#{"  << szSize <<" = RADIAL_MESH_SIZE}" << std::endl;
         [ #  # ][ #  # ]
     364                 :            :           }
     365 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     366                 :            : 
     367                 :            :         // mesh all command after meshing surface
     368         [ #  # ]:          0 :         if (m_nDuct <= 1 ){
     369                 :            : #ifdef HAVE_RGG16
     370                 :            :             m_FileOutput << "group 'tmpgrp' add surface with name '*_top*'" << std::endl;
     371                 :            : #else
     372 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'tmpgrp' add surface with name '_top'" << std::endl;
     373                 :            : #endif
     374         [ #  # ]:          0 :             if (m_nBLAssemblyMat !=0){ // only if boundary layers are specified
     375 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp1' subtract innerduct from tmpgrp" << std::endl;
     376 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp2' subtract bl_surfaces from tmpgrp1" << std::endl;
     377 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh tmpgrp2" << std::endl;
     378                 :            :               }
     379                 :            :             else
     380                 :            :               {
     381 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh tmpgrp" << std::endl;
     382                 :            :               }
     383                 :            :           }
     384                 :            :         else {
     385 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#Meshing top surface" << std::endl;
     386                 :            :             //m_FileOutput << "mesh surface with z_coord = " << z2 << std::endl;
     387 [ #  # ][ #  # ]:          0 :             if(m_szMeshScheme == "hole" && m_nBLAssemblyMat == 0){
         [ #  # ][ #  # ]
     388                 :            : #ifdef HAVE_RGG16
     389                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "*\"" << std::endl;
     390                 :            : #else
     391 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "\"" << std::endl;
         [ #  # ][ #  # ]
     392                 :            : #endif
     393 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'remove_hole' intersect group tmpgrp with group hole_surfaces" << std::endl;
     394 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{nIntersect=NumInGrp('remove_hole')}" << std::endl;
     395 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{If(nIntersect==0)}" << std::endl;
     396 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     397 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp scheme {" << "PAVE" << "}"  << std::endl;
         [ #  # ][ #  # ]
     398 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{endif}"  << std::endl;
     399 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh surface with z_coord = {Zmax}" << std::endl;
     400                 :            :               }
     401         [ #  # ]:          0 :             else if (m_nBLAssemblyMat != 0){ // mesh by spefifying boundary layers or mesh partially
     402                 :            : #ifdef HAVE_RGG16
     403                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name '*_top*'" << std::endl;
     404                 :            : #else
     405 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name '_top'" << std::endl;
     406                 :            : #endif
     407 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp1' subtract innerduct from tmpgrp" << std::endl;
     408 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp2' subtract bl_surfaces from tmpgrp1" << std::endl;
     409 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp3' equals surface in tmpgrp2 with z_coord = {Zmax}" << std::endl;
     410                 :            : 
     411 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp3  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     412 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp3 scheme {" << "PAVE" << "}"  << std::endl;
         [ #  # ][ #  # ]
     413 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh tmpgrp3" << std::endl;
     414                 :            : 
     415                 :            :               }
     416                 :            :             else {
     417                 :            : #ifdef HAVE_RGG16
     418                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "*\"" << std::endl;
     419                 :            : #else
     420 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name \""  << szSurfTop  << "\"" << std::endl;
         [ #  # ][ #  # ]
     421                 :            : #endif
     422 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp  size {"  << szSize <<"}" << std::endl;
         [ #  # ][ #  # ]
     423 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "surface in tmpgrp scheme {" << "PAVE" << "}"  << std::endl;
         [ #  # ][ #  # ]
     424 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh surface with z_coord = {Zmax}" << std::endl;
     425                 :            :               }
     426                 :            :           }
     427                 :            :         // This part is for mesh top surfaces only when boundary layer surfaces are specified
     428         [ #  # ]:          0 :         if (m_nBLAssemblyMat !=0){
     429                 :            :             // Also look for material name in BL material list
     430         [ #  # ]:          0 :             for (int ll=1; ll<= m_nBLAssemblyMat; ll++){
     431                 :          0 :                 bool duct = false;
     432         [ #  # ]:          0 :                 for (int n = 0; n < (int) m_szDuctMats.size(); n++){
     433 [ #  # ][ #  # ]:          0 :                     if (strcmp(m_szDuctMats[n].c_str(), m_szBLAssmMat(ll).c_str()) == 0)
                 [ #  # ]
     434                 :          0 :                       duct = true;
     435                 :            :                     else
     436                 :          0 :                       duct = false;
     437                 :            :                   }
     438         [ #  # ]:          0 :                 if (duct){                 //We want to use this part with pair node only for ducts and not cylinderical pins so check if this material is duct or not
     439         [ #  # ]:          0 :                     if (m_edgeInterval != 99)
     440 [ #  # ][ #  # ]:          0 :                       m_FileOutput << "curve in surf in " << m_szBLAssmMat(ll) << "_hole_surfaces interval {TOP_EDGE_INTERVAL}"<< std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     441 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "mesh vertex in surf in " << m_szBLAssmMat(ll) << "_hole_surfaces with z_coord = {Zmax}" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     442 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "#{corner1 = Id('node')} " << std::endl;
     443 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group 'gcurves' equals curve in surface in " << m_szBLAssmMat(ll) << "_hole_surfaces'" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     444 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "#{_cntr=0} " << "\n" <<
     445 [ #  # ][ #  # ]:          0 :                                     "#{_tmp_dis=0} " << "\n" <<
     446 [ #  # ][ #  # ]:          0 :                                     "#{_min_dis=0}  " << "\n" <<
     447 [ #  # ][ #  # ]:          0 :                                     "#{_closest_node=11} " << "\n" <<
     448                 :            : 
     449 [ #  # ][ #  # ]:          0 :                                     "group 'v_node' equals node in volume in surface in " <<  m_szBLAssmMat(ll) << "_hole_surfaces" << "\n" <<
         [ #  # ][ #  # ]
                 [ #  # ]
     450 [ #  # ][ #  # ]:          0 :                                     "group v_node remove node {corner1} " << "\n" <<
     451 [ #  # ][ #  # ]:          0 :                                     "#{xc1 = Nx(corner1)} " << "\n" <<
     452 [ #  # ][ #  # ]:          0 :                                     "#{yc1 = Ny(corner1)} " << "\n" <<
     453 [ #  # ][ #  # ]:          0 :                                     "#{_num_nodes = NumInGrp('v_node')} " << "\n" <<
     454 [ #  # ][ #  # ]:          0 :                                     "#{_min_dis = 1.e10} " << "\n" <<
     455 [ #  # ][ #  # ]:          0 :                                     "#{Loop(20)} " << "\n" <<
     456 [ #  # ][ #  # ]:          0 :                                     "#{_node_id = GroupMemberId('v_node', 'node', _cntr)} " << "\n" <<
     457 [ #  # ][ #  # ]:          0 :                                     "#{_xni = Nx(_node_id)} " << "\n" <<
     458 [ #  # ][ #  # ]:          0 :                                     "#{_yni = Ny(_node_id)} " << "\n" <<
     459 [ #  # ][ #  # ]:          0 :                                     "#{_tmp_dis = (xc1 - _xni)*(xc1 -_xni) + (yc1 -_yni)*(yc1 - _yni)} " << "\n" <<
     460 [ #  # ][ #  # ]:          0 :                                     "#{if(_tmp_dis < _min_dis)} " << "\n" <<
     461 [ #  # ][ #  # ]:          0 :                                     "#{ _closest_node = _node_id} " << "\n" <<
     462 [ #  # ][ #  # ]:          0 :                                     "# {_min_dis=_tmp_dis} " << "\n" <<
     463 [ #  # ][ #  # ]:          0 :                                     "#{endif} " << "\n" <<
     464 [ #  # ][ #  # ]:          0 :                                     "#{_cntr++} " << "\n" <<
     465 [ #  # ][ #  # ]:          0 :                                     "#{if (_cntr >_num_nodes)} " << "\n" <<
     466 [ #  # ][ #  # ]:          0 :                                     "#{break} " << "\n" <<
     467 [ #  # ][ #  # ]:          0 :                                     "#{endif} " << "\n" <<
     468 [ #  # ][ #  # ]:          0 :                                     "#{EndLoop} " << "\n" << std::endl;
                 [ #  # ]
     469                 :            : 
     470                 :            :                     // This must be used only for ducts
     471                 :            :                     //   if (m_szBLAssmMat(ll) == duct material or it's not pin material')
     472 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces scheme hole rad_intervals "
         [ #  # ][ #  # ]
     473 [ #  # ][ #  # ]:          0 :                                  << m_nBLMatIntervals(ll) << " bias " << m_dBLMatBias(ll) << " pair node {corner1} with node {_closest_node}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     474                 :            :                   }
     475                 :            :                 else { // this is regular cylinder
     476 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces scheme hole rad_intervals "
         [ #  # ][ #  # ]
     477 [ #  # ][ #  # ]:          0 :                                  << m_nBLMatIntervals(ll) << " bias " << m_dBLMatBias(ll) << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     478                 :            :                   }
     479                 :            : 
     480 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces with z_coord = {Zmax}" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     481         [ #  # ]:          0 :                 if(strcmp(m_szSmooth.c_str(),"on") == 0)
     482 [ #  # ][ #  # ]:          0 :                   m_FileOutput << "smooth surf in group " << m_szBLAssmMat(ll) << "_hole_surfaces" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     483                 :            :               }
     484 [ #  # ][ #  # ]:          0 :             m_FileOutput << "mesh surf in innerduct with z_coord = {Zmax}" << std::endl;
     485                 :            :           }
     486                 :            : 
     487         [ #  # ]:          0 :         if(m_nPlanar == 0){ // volumes only
     488         [ #  # ]:          0 :             if (m_nDuct == 1){
     489         [ #  # ]:          0 :                 m_FileOutput << "surf with z_coord > {Z_MID -.1*Z_HEIGHT}" <<
     490 [ #  # ][ #  # ]:          0 :                                 " and z_coord < {Z_MID + .1*Z_HEIGHT} size {AXIAL_MESH_SIZE}" << std::endl ;
     491 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "mesh vol all" << std::endl;
     492                 :            :               }
     493         [ #  # ]:          0 :             else if (m_nDuct > 1){
     494 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "### Setting Z intervals on ducts and meshing along Z " << std::endl;
     495         [ #  # ]:          0 :                 for( int p=m_nDuct; p>= 1; p--){
     496         [ #  # ]:          0 :                     if(dMid == 0){ // z - centered
     497 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "surf with z_coord  > " << m_dMZAssm(p, 1) - dHeight/2.0
                 [ #  # ]
     498 [ #  # ][ #  # ]:          0 :                                      << " and z_coord < " << m_dMZAssm(p, 2) - dHeight/2.0 << " interval " << "{BLOCK" << p << "_Z_INTERVAL}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     499 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "mesh vol with z_coord  > " << m_dMZAssm(p, 1) - dHeight/2.0
                 [ #  # ]
     500 [ #  # ][ #  # ]:          0 :                                      << " and z_coord < " << m_dMZAssm(p, 2) - dHeight/2.0 << std::endl;
         [ #  # ][ #  # ]
     501                 :            :                       }
     502                 :            :                     else{
     503 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "surf with z_coord  > " << m_dMZAssm(p, 1)
                 [ #  # ]
     504 [ #  # ][ #  # ]:          0 :                                      << " and z_coord < " << m_dMZAssm(p, 2) << " interval " << "{BLOCK" << p << "_Z_INTERVAL}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     505 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "mesh vol with z_coord  > " << m_dMZAssm(p, 1)
                 [ #  # ]
     506 [ #  # ][ #  # ]:          0 :                                      << " and z_coord < " << m_dMZAssm(p, 2) << std::endl;
         [ #  # ][ #  # ]
     507                 :            : 
     508 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "##" << std::endl;
     509                 :            :                       }
     510                 :            :                   }
     511                 :            :               }
     512                 :            :           }
     513                 :            :       }
     514                 :            : 
     515 [ +  - ][ +  - ]:          1 :     else if(m_szMeshType == "tet"){
     516 [ +  - ][ +  - ]:          1 :         m_FileOutput << "##"<< std::endl;
     517 [ +  - ][ +  - ]:          1 :         m_FileOutput << "# groupings for creating vertex groups"<< std::endl;
     518         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     519         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     520                 :            : #ifdef HAVE_RGG16
     521                 :            :                 m_FileOutput << "group 'edge" << (m_nSides*(p-1) + q ) <<"' equals curve with name 'side_edge"
     522                 :            :                              << (m_nSides*(p-1) + q ) << "*'" << std::endl;
     523                 :            : #else
     524 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'edge" << (m_nSides*(p-1) + q ) <<"' equals curve with name 'side_edge"
                 [ +  - ]
     525 [ +  - ][ +  - ]:          4 :                              << (m_nSides*(p-1) + q ) << "@'" << std::endl;                
                 [ +  - ]
     526                 :            : #endif
     527                 :            : 
     528 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'vt" <<  (m_nSides*(p-1) + q )  <<"' equals vertex with z_max == z_min in curve in edge"
                 [ +  - ]
     529 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << std::endl;
     530                 :            : 
     531                 :            :               }
     532                 :            :           }
     533                 :            : 
     534                 :            :         // creating groups for vertices on the top surface of the duct
     535         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     536         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     537                 :            : 
     538         [ +  + ]:          4 :                 if(q != m_nSides){
     539 [ +  - ][ +  - ]:          3 :                     m_FileOutput << "group 'v" << (m_nSides*(p-1) + q ) <<"' intersect group vt" << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     540 [ +  - ][ +  - ]:          3 :                                  << " with group vt" <<  (m_nSides*(p-1) + q + 1 )  << std::endl;
                 [ +  - ]
     541                 :            :                   }
     542                 :            :                 else {
     543 [ +  - ][ +  - ]:          1 :                     m_FileOutput << "group 'v" << (m_nSides*(p-1) + q ) <<"' intersect group vt" << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     544 [ +  - ][ +  - ]:          1 :                                  << " with group vt" <<  (m_nSides*(p-1) + 1 )  << std::endl;
                 [ +  - ]
     545                 :            :                   }
     546                 :            :               }
     547                 :            :           }
     548                 :            : 
     549                 :            :         // creating temp surfaces groups
     550         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     551         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     552 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'st" << (m_nSides*(p-1) + q ) <<"' equals surface with z_max <> z_min in vert in v"
                 [ +  - ]
     553 [ +  - ][ +  - ]:          4 :                              << (m_nSides*(p-1) + q ) << "'" << std::endl;
                 [ +  - ]
     554                 :            :               }
     555                 :            :           }
     556                 :            : 
     557                 :            :         // creating side curve and surface groups
     558         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     559         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     560                 :            : 
     561 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'c" <<  (m_nSides*(p-1) + q )  <<"' equals curve with z_max <> z_min in vert in v"
                 [ +  - ]
     562 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << std::endl;
     563                 :            : 
     564         [ +  + ]:          4 :                 if(q != 1){
     565 [ +  - ][ +  - ]:          3 :                     m_FileOutput << "group 's" << (m_nSides*(p-1) + q ) <<"' intersect group st"  << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     566 [ +  - ][ +  - ]:          3 :                                  << " with group st" <<  (m_nSides*(p-1) + q - 1 )  << std::endl;
                 [ +  - ]
     567                 :            :                   }
     568                 :            :                 else {
     569 [ +  - ][ +  - ]:          1 :                     m_FileOutput << "group 's" << (m_nSides*(p-1) + q ) <<"' intersect group st" << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     570 [ +  - ][ +  - ]:          1 :                                  << " with group st" <<  (m_nSides*(p-1) + m_nSides )  << std::endl;
                 [ +  - ]
     571                 :            :                   }
     572                 :            :               }
     573                 :            :           }
     574                 :            : 
     575                 :            :         // renaming the side surfaces for getting the split surfaces later
     576         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     577         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     578 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "surface in group s" <<  (m_nSides*(p-1) + q ) << " rename 'side_surface"
                 [ +  - ]
     579 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << "'" << std::endl;
                 [ +  - ]
     580                 :            :               }
     581                 :            :           }
     582                 :            : 
     583                 :            :         // splitting the surfaces
     584         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     585         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     586                 :            : 
     587 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "split surface in group s" <<  (m_nSides*(p-1) + q )  <<" direction curve in group c"
                 [ +  - ]
     588 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << std::endl;
     589                 :            :               }
     590                 :            :           }
     591                 :            : 
     592                 :            :         // get all the split surfaces in individual groups
     593         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     594         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     595                 :            : #ifdef HAVE_RGG16
     596                 :            :                 m_FileOutput << "group 'sname" << (m_nSides*(p-1) + q ) <<  "' equals surface with name 'side_surface"
     597                 :            :                              <<  (m_nSides*(p-1) + q ) << "*'"<< std::endl;
     598                 :            : #else
     599 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'sname" << (m_nSides*(p-1) + q ) <<  "' equals surface with name 'side_surface"
                 [ +  - ]
     600 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << "'"<< std::endl;
                 [ +  - ]
     601                 :            : #endif
     602 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'svert" << (m_nSides*(p-1) + q ) <<  "' equals surface in vert in v"
                 [ +  - ]
     603 [ +  - ][ +  - ]:          4 :                              <<  (m_nSides*(p-1) + q ) << std::endl;
     604 [ +  - ][ +  - ]:          4 :                 m_FileOutput << "group 'ssplit" << (m_nSides*(p-1) + q ) <<  "' intersect group sname" <<  (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     605 [ +  - ][ +  - ]:          4 :                              << " with group svert" << (m_nSides*(p-1) + q ) << std::endl;
                 [ +  - ]
     606                 :            :               }
     607                 :            :           }
     608                 :            : 
     609                 :            :         // get all the split surfaces in individual groups
     610         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     611         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     612                 :            : 
     613         [ +  + ]:          4 :                 if(q != 1){
     614 [ +  - ][ +  - ]:          3 :                     m_FileOutput << "group 'ssplit_" << (m_nSides*(p-1) + q ) <<"' intersect group sname"  << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     615 [ +  - ][ +  - ]:          3 :                                  << " with group svert" <<  (m_nSides*(p-1) + q - 1 )  << std::endl;
                 [ +  - ]
     616                 :            :                   }
     617                 :            :                 else {
     618 [ +  - ][ +  - ]:          1 :                     m_FileOutput << "group 'ssplit_" <<  (m_nSides*(p-1) + q ) <<"' intersect group sname" << (m_nSides*(p-1) + q )
         [ +  - ][ +  - ]
     619 [ +  - ][ +  - ]:          1 :                                  << " with group svert" <<  (m_nSides*(p-1) + m_nSides )  << std::endl;
                 [ +  - ]
     620                 :            :                   }
     621                 :            :               }
     622                 :            :           }
     623                 :            :         // imprint
     624 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#Imprint geometry" << std::endl;
     625 [ +  - ][ +  - ]:          1 :         m_FileOutput << "imprint all" << std::endl;
     626 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#" << std::endl;
     627 [ +  - ][ +  - ]:          1 :         m_FileOutput << "Merge Tolerance " << m_dMergeTol << std::endl;
                 [ +  - ]
     628 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#" << std::endl;
     629                 :            : 
     630                 :            :         // merge
     631 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#Merge geometry" << std::endl;
     632 [ +  - ][ +  - ]:          1 :         m_FileOutput << "merge all" << std::endl;
     633 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#" << std::endl;
     634                 :            : 
     635 [ +  - ][ +  - ]:          1 :         m_FileOutput << "#Set mesh scheme and size" << std::endl;
     636 [ +  - ][ +  - ]:          1 :         m_FileOutput << "volume all scheme {TET} size {TET_MESH_SIZE}" << std::endl;
     637                 :            : 
     638                 :            :         // mesh one side of each duct, such that one is flipped mesh of the other
     639         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     640                 :            : 
     641 [ +  - ][ +  - ]:          1 :             m_FileOutput << "mesh surface in group ssplit" <<  (m_nSides*(p-1) + 1) << std::endl;
                 [ +  - ]
     642                 :            : 
     643 [ +  - ][ +  - ]:          1 :             m_FileOutput << "surface in group ssplit_" << (m_nSides*(p-1) + 1) << " scheme copy source surface in group ssplit"
                 [ +  - ]
     644         [ +  - ]:          1 :                          <<  (m_nSides*(p-1) + 1)
     645 [ +  - ][ +  - ]:          1 :                           << " source curve in group c" <<  (m_nSides*(p-1) + 1 ) << " target curve in group c" <<  (m_nSides*(p-1) + m_nSides )
         [ +  - ][ +  - ]
     646 [ +  - ][ +  - ]:          1 :                           << " source vertex in group v" <<  (m_nSides*(p-1) + 1) << " target vertex in group v"  <<  (m_nSides*(p-1) + m_nSides )
         [ +  - ][ +  - ]
     647 [ +  - ][ +  - ]:          1 :                           << " nosmoothing" << std::endl;
     648                 :            : 
     649 [ +  - ][ +  - ]:          1 :             m_FileOutput << "mesh surface in group  ssplit_" << (m_nSides*(p-1) + 1) << std::endl;
                 [ +  - ]
     650                 :            :           }
     651                 :            : 
     652                 :            :         // setting the copy mesh commands on the above pair of split surfaces to have all surfaces symmetrical
     653         [ +  + ]:          2 :         for (int p=1; p<=m_nDuct; p++){
     654         [ +  + ]:          5 :             for(int q=1;q<=m_nSides; q++){
     655         [ +  + ]:          4 :                 if(q != m_nSides){
     656                 :            : #ifdef HAVE_RGG16
     657                 :            :                     m_FileOutput << "copy mesh surface in ssplit" <<  (m_nSides*(p-1) + 1)
     658                 :            :                                  << " onto surface in ssplit" << (m_nSides*(p-1) + q + 1 )
     659                 :            :                                  << " source curve in group c" << (m_nSides*(p-1) + 1)
     660                 :            :                                  << " source vertex in group v" << (m_nSides*(p-1) + 1)                                   
     661                 :            :                                  << " target curve in group c" <<  (m_nSides*(p-1) + q + 1) 
     662                 :            :                                  << " target vertex in group v" <<  (m_nSides*(p-1) + q + 1) << " " <<  std::endl;
     663                 :            : 
     664                 :            :                     m_FileOutput << "copy mesh surface in ssplit_" << (m_nSides*(p-1) + 1 )
     665                 :            :                                  << " onto surface in ssplit_" << (m_nSides*(p-1) + q +1 )
     666                 :            :                                  << " source curve in group c" << (m_nSides*p)
     667                 :            :                                  << " source vertex in group v" << (m_nSides*p)
     668                 :            :                                  << " target curve in group c" <<  (m_nSides*(p-1) + q) 
     669                 :            :                                  << " target vertex in group v" <<  (m_nSides*(p-1) + q) << " " << std::endl;
     670                 :            : #else
     671 [ +  - ][ +  - ]:          3 :                     m_FileOutput << "copy mesh surface in ssplit" <<  (m_nSides*(p-1) + 1)
     672 [ +  - ][ +  - ]:          3 :                                  << " onto surface in ssplit" << (m_nSides*(p-1) + q + 1 )
     673 [ +  - ][ +  - ]:          3 :                                  << " source vertex in group v" << (m_nSides*(p-1) + 1)
     674 [ +  - ][ +  - ]:          3 :                                  << " target vertex in group v" <<  (m_nSides*(p-1) + q + 1) << " nosmoothing" <<  std::endl;
         [ +  - ][ +  - ]
     675                 :            : 
     676 [ +  - ][ +  - ]:          3 :                     m_FileOutput << "copy mesh surface in ssplit_" << (m_nSides*(p-1) + 1 )
     677 [ +  - ][ +  - ]:          3 :                                  << " onto surface in ssplit_" << (m_nSides*(p-1) + q +1 )
     678 [ +  - ][ +  - ]:          3 :                                  << " source vertex in group v" << (m_nSides*p)
     679 [ +  - ][ +  - ]:          3 :                                  << " target vertex in group v" <<  (m_nSides*(p-1) + q) << " nosmoothing" << std::endl;          
         [ +  - ][ +  - ]
     680                 :            : #endif
     681                 :            : 
     682                 :            :                   }
     683                 :            :                 else{
     684                 :            :                     // do nothing
     685                 :            :                   }
     686                 :            :               }
     687                 :            :           }
     688                 :            : 
     689 [ +  - ][ +  - ]:          1 :         m_FileOutput << "# Mesh all volumes now" << std::endl;
     690 [ +  - ][ +  - ]:          1 :         m_FileOutput << "mesh vol all" << std::endl;
     691                 :            :       }
     692                 :            : 
     693                 :            :     // create and sidesets after meshing
     694 [ +  - ][ +  - ]:          1 :     m_FileOutput << "#" << std::endl;
     695                 :            :     //    }
     696 [ +  - ][ -  + ]:          1 :     if(m_szSideset == "yes"){
     697                 :            :         // top surface sidesets
     698 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Creating top surface sidesets" << std::endl;
     699 [ #  # ][ #  # ]:          0 :         m_FileOutput << "create group 'surfall'" << std::endl;
     700 [ #  # ][ #  # ]:          0 :         for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     701                 :          0 :             ++nSideset;
     702 [ #  # ][ #  # ]:          0 :             szSurfTop = m_szAssmMat(p)+"_top";
                 [ #  # ]
     703                 :            :             // Avoid creation if empty sideset
     704                 :            : #ifdef HAVE_RGG16
     705                 :            :             m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "*' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
     706                 :            : #else
     707 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     708                 :            : #endif
     709 [ #  # ][ #  # ]:          0 :             m_FileOutput << "sideset " << nSideset << " surface in tmpgrp " << std::endl;
         [ #  # ][ #  # ]
     710 [ #  # ][ #  # ]:          0 :             m_FileOutput << "sideset " << nSideset << " name \"" << szSurfTop << "_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     711                 :            :           }
     712 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     713         [ #  # ]:          0 :         for(int p=1;p<=m_nBLAssemblyMat;p++){
     714                 :          0 :             ++nSideset;
     715                 :            : 
     716                 :            :             // Avoid creation if empty sideset
     717                 :            : #ifdef HAVE_RGG16
     718                 :            :             m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "*' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
     719                 :            : #else
     720 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     721                 :            : #endif
     722 [ #  # ][ #  # ]:          0 :             m_FileOutput << "sideset " << nSideset << " surface in tmpgrp " << std::endl;
         [ #  # ][ #  # ]
     723 [ #  # ][ #  # ]:          0 :             m_FileOutput << "sideset " << nSideset << " name \"" << szSurfTop << "_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     724                 :            :           }
     725 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#" << std::endl;
     726                 :            :       }
     727                 :            : 
     728                 :            : 
     729         [ +  - ]:          1 :     if(m_nPlanar ==0){
     730 [ +  - ][ -  + ]:          1 :         if(m_szSideset == "yes"){
     731                 :            :             // now create bot and side sideset
     732 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#Creating bot/side surface sidesets" << std::endl;
     733 [ #  # ][ #  # ]:          0 :             for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     734 [ #  # ][ #  # ]:          0 :                 szSurfTop = m_szAssmMat(p)+"_bot";
                 [ #  # ]
     735 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#" << std::endl;
     736                 :          0 :                 ++nSideset;
     737                 :            : #ifdef HAVE_RGG16
     738                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "*' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
     739                 :            : #else
     740 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "' in vol in block " << m_nMaterialSetId + p -1 << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     741                 :            : #endif
     742 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "sideset " << nSideset << " surface in tmpgrp " << std::endl;
         [ #  # ][ #  # ]
     743 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "sideset " << nSideset << " name \"" << szSurfTop << "_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     744                 :            :               }
     745         [ #  # ]:          0 :             for(int p=1;p<=m_nBLAssemblyMat;p++){
     746                 :          0 :                 ++nSideset;
     747 [ #  # ][ #  # ]:          0 :                 szSurfTop = m_szAssmMat(p)+"_bot";
                 [ #  # ]
     748                 :            : 
     749                 :            :                 // Avoid creation if empty sideset
     750                 :            : #ifdef HAVE_RGG16
     751                 :            :                 m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << "*" << std::endl;
     752                 :            : #else
     753 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp' equals surface with name '" << szSurfTop << std::endl;
                 [ #  # ]
     754                 :            : #endif
     755 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "sideset " << nSideset << " surface in tmpgrp " << std::endl;
         [ #  # ][ #  # ]
     756 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "sideset " << nSideset << " name \"" << szSurfTop << "_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     757                 :            :               }
     758 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#" << std::endl;
     759                 :            : 
     760 [ #  # ][ #  # ]:          0 :             for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     761 [ #  # ][ #  # ]:          0 :                 szSurfSide = m_szAssmMat(p)+"_side";
                 [ #  # ]
     762                 :          0 :                 ++nSideset;
     763 [ #  # ][ #  # ]:          0 :                 if(m_szGeomType == "hexagonal"){
     764         [ #  # ]:          0 :                     for (int u=1; u<=6;u++){
     765                 :            : #ifdef HAVE_RGG16
     766                 :            :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "*'" << std::endl;
     767                 :            : #else
     768 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "'" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     769                 :            : #endif
     770                 :            :                       }
     771 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " surface in tmpgrp1 tmpgrp2 tmpgrp3 tmpgrp4 tmpgrp5 tmpgrp6" << std::endl;
         [ #  # ][ #  # ]
     772 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " name \"" << szSurfSide << "1_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     773                 :          0 :                     ++nSideset;
     774                 :            :                   }
     775 [ #  # ][ #  # ]:          0 :                 if(m_szGeomType == "hexagonal"){
     776         [ #  # ]:          0 :                     for (int u=7; u<=12;u++){
     777                 :            : #ifdef HAVE_RGG16
     778                 :            :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "*'" << std::endl;
     779                 :            : #else
     780 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "'" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     781                 :            : #endif
     782                 :            :                       }
     783 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " surface in tmpgrp7 tmpgrp8 tmpgrp9 tmpgrp10 tmpgrp11 tmpgrp12" << std::endl;
         [ #  # ][ #  # ]
     784 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " name \"" << szSurfSide << "2_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     785                 :            :                   }
     786 [ #  # ][ #  # ]:          0 :                 if(m_szGeomType == "rectangular"){
     787         [ #  # ]:          0 :                     for (int u=1; u<=4;u++){
     788                 :            : #ifdef HAVE_RGG16
     789                 :            :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "*'" << std::endl;
     790                 :            : #else
     791 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "'" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     792                 :            : #endif
     793                 :            :                       }
     794 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " surface in tmpgrp1 tmpgrp2 tmpgrp3 tmpgrp4'" << std::endl;
         [ #  # ][ #  # ]
     795 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " name \"" << szSurfSide << "2_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     796                 :          0 :                     ++nSideset;
     797                 :            :                   }
     798                 :            : 
     799 [ #  # ][ #  # ]:          0 :                 if(m_szGeomType == "rectangular"){
     800         [ #  # ]:          0 :                     for (int u=5; u<=8;u++){
     801                 :            : #ifdef HAVE_RGG16
     802                 :            :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "*'" << std::endl;
     803                 :            : #else
     804 [ #  # ][ #  # ]:          0 :                         m_FileOutput << "group 'tmpgrp" << u <<"' equals surf with name '" << szSurfSide << u << "'" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     805                 :            : #endif
     806                 :            :                       }
     807 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " surface in tmpgrp5 tmpgrp6 tmpgrp7 tmpgrp8'" << std::endl;
         [ #  # ][ #  # ]
     808 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "sideset " << nSideset << " name \"" << szSurfSide << "2_ss\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     809                 :            :                   }
     810                 :            :               }
     811                 :            : 
     812                 :            : 
     813 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#" << std::endl;
     814                 :            : 
     815 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#Creating sideset for outer most side surfaces" << std::endl;
     816                 :          0 :             ++nSideset;
     817                 :            : #ifdef HAVE_RGG16
     818                 :            :             m_FileOutput << "group 'tmpgrp' equals surf with name 'side_surface*'" << std::endl;
     819                 :            : #else
     820 [ #  # ][ #  # ]:          0 :             m_FileOutput << "group 'tmpgrp' equals surf with name 'side_surface'" << std::endl;
     821                 :            : #endif
     822 [ #  # ][ #  # ]:          0 :             m_FileOutput << "sideset " << nSideset << " surface in tmpgrp " << std::endl;
         [ #  # ][ #  # ]
     823 [ #  # ][ #  # ]:          1 :             m_FileOutput << "sideset " << nSideset << " name \"" << "outer_side_ss\"" << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     824                 :            :           }
     825                 :            :       }
     826         [ -  + ]:          1 :     if(m_nHblock != -1){ // if more blocks are needed axially, create'em using hexes and the end
     827                 :            :         // block creation dumps
     828 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Creating blocks, Note: you might need to combine some blocks" << std::endl;
     829                 :            :         // group creation dumps. each material has a group
     830 [ #  # ][ #  # ]:          0 :         m_FileOutput << "#Creating groups" << std::endl;
     831 [ #  # ][ #  # ]:          0 :         if(m_szMeshType == "hex"){
     832 [ #  # ][ #  # ]:          0 :             for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     833 [ #  # ][ #  # ]:          0 :                 szGrp = "g_"+ m_szAssmMat(p);
                 [ #  # ]
     834         [ #  # ]:          0 :                 m_szAssmMat(p);
     835         [ #  # ]:          0 :                 if(m_nPlanar ==1){
     836                 :            : #ifdef HAVE_RGG16
     837                 :            :                     m_FileOutput << "group \"" << szGrp << "\" add surface with name \"" << m_szAssmMat(p) <<"*\"" << std::endl;
     838                 :            : #else
     839 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group \"" << szGrp << "\" add surface with name \"" << m_szAssmMat(p) <<"\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     840                 :            : #endif
     841                 :            :                   }
     842                 :            :                 else{
     843                 :            : #ifdef HAVE_RGG16
     844                 :            :                     m_FileOutput << "group \"" << szGrp << "\" add body with name \"" << m_szAssmMat(p) <<"*\"" << std::endl;
     845                 :            : #else
     846 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "group \"" << szGrp << "\" add body with name \"" << m_szAssmMat(p) <<"\"" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     847                 :            : #endif
     848                 :            :                   }
     849                 :            :               }
     850 [ #  # ][ #  # ]:          0 :             for(int p = 1; p <=  (m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     851 [ #  # ][ #  # ]:          0 :                 szBlock = "b_"+ m_szAssmMat(p);
                 [ #  # ]
     852 [ #  # ][ #  # ]:          0 :                 szGrp = "g_"+ m_szAssmMat(p);
                 [ #  # ]
     853 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{nb" << p << " =NumInGrp('" << szGrp << "')}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     854 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{Ifndef(nb" << p << ")}" << "\n" << "#{else}" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     855         [ #  # ]:          0 :                 if(m_nPlanar ==1){
     856 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "block " << m_nMaterialSetId + p -1 << " surface in " << szGrp  << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     857 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "block " << m_nMaterialSetId + p -1 << " name \"" << szBlock <<"\""<< std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     858                 :            :                   }
     859                 :            :                 else{
     860 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "block " << m_nMaterialSetId + p -1 << " hex in body in " << szGrp  << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     861 [ #  # ][ #  # ]:          0 :                     m_FileOutput << "block " << m_nMaterialSetId + p -1 << " name \"" << szBlock <<"\""<< std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     862                 :            :                   }
     863 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "#{endif}" << std::endl;
     864                 :            :               }
     865 [ #  # ][ #  # ]:          0 :             m_FileOutput << "#" << std::endl;
     866                 :            :           }
     867                 :            :         else{
     868 [ #  # ][ #  # ]:          0 :             std::cout << "Error: Terminating journal file writing. \n Hex block (Hblock keyword) is not supported for a tet mesh." << std::endl;
     869                 :          0 :             exit(1);
     870                 :            :           }
     871                 :            :       }
     872                 :            : 
     873                 :            :     // create super blocks
     874         [ -  + ]:          1 :     if(m_nSuperBlocks > 0){
     875         [ #  # ]:          0 :         for(int o = 1; o <= m_nSuperBlocks; o++){
     876 [ #  # ][ #  # ]:          0 :             m_FileOutput << "block " << sb(o).m_nSuperBlockId << " vol in block ";
         [ #  # ][ #  # ]
     877 [ #  # ][ #  # ]:          0 :             for (int p = 1; p <= sb(o).m_nNumSBContents; p++){
     878 [ #  # ][ #  # ]:          0 :                 m_FileOutput << m_nMaterialSetId + sb(o).m_nSBContents(p) << " ";
         [ #  # ][ #  # ]
     879                 :            :               }
     880 [ #  # ][ #  # ]:          0 :             m_FileOutput << "\n" << "block " << sb(o).m_nSuperBlockId << " name '" << sb(o).m_szSuperBlockAlias << "'" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
                 [ #  # ]
     881         [ #  # ]:          0 :             m_FileOutput << "delete block " ;
     882 [ #  # ][ #  # ]:          0 :             for (int q = 1; q <= sb(o).m_nNumSBContents; q++){
     883 [ #  # ][ #  # ]:          0 :                 m_FileOutput << m_nMaterialSetId + sb(o).m_nSBContents(q) << " ";
         [ #  # ][ #  # ]
     884                 :            :               }
     885 [ #  # ][ #  # ]:          0 :             m_FileOutput << "\n" << std::endl;
     886                 :            :           }
     887                 :            :       }
     888                 :            : 
     889                 :            : 
     890                 :            : 
     891         [ -  + ]:          1 :     if(m_nHblock > 0){
     892                 :            :         // now dump the commands for making hex layers as blocks and subtracting from original
     893                 :          0 :         double delta = (m_dZend - m_dZstart)/m_nHblock;
     894 [ #  # ][ #  # ]:          0 :         for(int i=0; i<(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat); i++){
     895 [ #  # ][ #  # ]:          0 :             m_FileOutput << "## BLOCK CREATION USING HEXES" << std::endl;
     896         [ #  # ]:          0 :             for(int j=0; j<m_nHblock; j++){
     897 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "group 'tmpgrp" << j+1 << "' equals hex in block " <<  m_nMaterialSetId + i
         [ #  # ][ #  # ]
     898 [ #  # ][ #  # ]:          0 :                              << " with z_coord < " << m_dZstart + (j+1)*delta << " and z_coord > "
                 [ #  # ]
     899 [ #  # ][ #  # ]:          0 :                              << m_dZstart + j*delta << std::endl;
     900                 :            :               }
     901         [ #  # ]:          0 :             for(int j=0; j<m_nHblock; j++){
     902 [ #  # ][ #  # ]:          0 :                 m_FileOutput << "block " <<  m_nMaterialSetId+i << " group tmpgrp" << j+1 << " remove" << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     903                 :            :               }
     904         [ #  # ]:          0 :             for(int j=0; j<m_nHblock; j++){
     905 [ #  # ][ #  # ]:          0 :                 if((m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat) < 10)
     906 [ #  # ][ #  # ]:          0 :                   m_FileOutput << "block " << j+1 <<  m_nMaterialSetId+i << " group tmpgrp" << j+1 << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     907                 :            :                 else
     908 [ #  # ][ #  # ]:          0 :                   m_FileOutput << "block " << (j+1)*10 <<  m_nMaterialSetId+i << " group tmpgrp" << j+1 << std::endl;
         [ #  # ][ #  # ]
         [ #  # ][ #  # ]
     909                 :            :               }
     910                 :            :           }
     911                 :            :       }
     912         [ -  + ]:          1 :     if(m_nMaterialSetId != 1)
     913 [ #  # ][ #  # ]:          0 :       m_FileOutput << "renumber hex all start_id " << MAXLINES*1000 << std::endl;
                 [ #  # ]
     914                 :            :     // color now
     915 [ +  - ][ +  - ]:          1 :     m_FileOutput << "#Set color for different parts" << std::endl;
     916         [ +  - ]:          1 :     if(m_nPlanar == 0){ // volumes only
     917 [ +  - ][ +  + ]:          4 :         for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     918 [ +  - ][ +  - ]:          3 :             szGrp = "g_"+ m_szAssmMat(p);
                 [ +  - ]
     919         [ -  + ]:          3 :             if(p>20)
     920                 :          0 :               nColor = 1;
     921                 :            :             else
     922                 :          3 :               nColor = p;
     923 [ +  - ][ +  - ]:          3 :             m_FileOutput << "color body in " << szGrp << " " << color[nColor] << std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
     924                 :            :           }
     925                 :            :       }
     926                 :            :     else{ //surfaces
     927                 :            :         // color now
     928 [ #  # ][ #  # ]:          0 :         for(int p=1;p<=(m_szAssmMatAlias.GetSize() - m_nBLAssemblyMat);p++){
     929 [ #  # ][ #  # ]:          0 :             szGrp = "g_"+ m_szAssmMat(p);
                 [ #  # ]
     930         [ #  # ]:          0 :             if(p>20)
     931                 :          0 :               nColor = 1;
     932                 :            :             else
     933                 :          0 :               nColor = p;
     934 [ #  # ][ #  # ]:          0 :             m_FileOutput << "color surface in " << szGrp << " " << color[nColor] << std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     935                 :            :           }
     936                 :            :       }
     937                 :            : 
     938 [ +  - ][ +  - ]:          1 :     m_FileOutput << "delete group all" << std::endl;
     939                 :            :     // save as .cub file dump
     940 [ +  - ][ +  - ]:          1 :     m_FileOutput << "#\n#Save file" << std::endl;
     941         [ -  + ]:          1 :     if(save_exodus){
     942         [ #  # ]:          0 :         std::string szSave = m_szFile + ".exo";
     943         [ #  # ]:          0 :         std::transform(szSave.begin(), szSave.end(), szSave.begin(), ::tolower);
     944 [ #  # ][ #  # ]:          0 :         m_FileOutput << "export mesh '"<< szSave <<"'" << " overwrite"<<std::endl;
         [ #  # ][ #  # ]
                 [ #  # ]
     945                 :            :       }
     946                 :            :     else{
     947         [ +  - ]:          1 :         std::string szSave = m_szFile + ".cub";
     948         [ +  - ]:          1 :         std::transform(szSave.begin(), szSave.end(), szSave.begin(), ::tolower);
     949 [ +  - ][ +  - ]:          1 :         m_FileOutput << "save as '"<< szSave <<"'" << " overwrite"<<std::endl;
         [ +  - ][ +  - ]
                 [ +  - ]
     950                 :            :       }
     951                 :            : 
     952 [ +  - ][ +  - ]:          1 :     std::cout << "Schemes file created: " << m_szSchFile << std::endl;
                 [ +  - ]
     953 [ +  - ][ +  - ]:          1 :     std::cout << "Cubit journal file created: " << m_szJouFile << std::endl;
                 [ +  - ]
     954         [ +  - ]:          1 :     if(strcmp(m_szInfo.c_str(),"on") == 0)
     955 [ +  - ][ +  - ]:          1 :       std::cout << "Assembly info file created: " << m_szAssmInfo << std::endl;
                 [ +  - ]
     956                 :            : 
     957 [ +  - ][ +  - ]:         23 :     m_FileOutput << "Timer Stop" << std::endl;
           [ +  +  #  # ]
     958                 :            : 
     959                 :          1 :   }
     960 [ +  - ][ +  - ]:        156 : }

Generated by: LCOV version 1.11