[MOAB-dev] r2543 - MOAB/trunk

Tim Tautges tautges at mcs.anl.gov
Wed Jan 14 09:42:03 CST 2009



kraftche at mcs.anl.gov wrote:
> Author: kraftche
> Date: 2009-01-13 21:31:32 -0600 (Tue, 13 Jan 2009)
> New Revision: 2543
> 
> Modified:
>    MOAB/trunk/Tqdcfr.cpp
> Log:
> Try to fix reading of higher-order elements for which the complete connectivty
> list is not stored explicitly (tri6, tri7, quad8, quad9, and perhaps cubit
> FullHex and FullTet elements with higher-order nodes).
> 
> 
> Modified: MOAB/trunk/Tqdcfr.cpp
> ===================================================================
> --- MOAB/trunk/Tqdcfr.cpp	2009-01-14 03:28:39 UTC (rev 2542)
> +++ MOAB/trunk/Tqdcfr.cpp	2009-01-14 03:31:32 UTC (rev 2543)
> @@ -22,6 +22,7 @@
>  #include "MBCN.hpp"
>  #include "MBInternals.hpp"
>  #include "FileOptions.hpp"
> +#include "HigherOrderFactory.hpp"
>  
>  #ifdef USE_MPI
>  #include "mpi.h"
> @@ -758,7 +759,27 @@
>      if (MB_SUCCESS != result) return result;
>    }
>  
> -  return MB_SUCCESS;
> +    // Put additional higher-order nodes into element connectivity list.
> +    // Cubit saves full connectivity list only for NodeHex and NodeTet
> +    // elements.  Other element types will only have the corners and
> +    // the mid-element node if there is one.  Need to reconsturct additional
> +    // connectivity entries from mid-nodes of adjacent lower-order entities.
> +  int node_per_elem = cub_elem_num_verts[blockh->blockElemType];
> +  if (MBCN::VerticesPerEntity(blockh->blockEntityType) == node_per_elem)
> +    return MB_SUCCESS;
> +  
> +    // Can't use MBInterface::convert_entities because block could contain
> +    // both entity sets and entities.  convert_entities will fail if block
> +    // contains an entity set, but we still need to call it on any elements
> +    // directly in the block (rather than a geometry subset).  So bypass
> +    // MBInterface and call HOFactory directly with an MBRange of entities.

Why not modify the convert_entities function to handle this case?  ("It 
would take too much time" is a fair answer in this case).

- tim


PS - thanks for fixing so quickly.

> +  MBRange entities;
> +  mdbImpl->get_entities_by_type( blockh->setHandle, blockh->blockEntityType, entities, true );
> +  
> +  int mid_nodes[4];
> +  MBCN::HasMidNodes( blockh->blockEntityType, node_per_elem, mid_nodes );
> +  HigherOrderFactory ho_fact( dynamic_cast<MBCore*>(mdbImpl), 0 );
> +  return ho_fact.convert( entities, !!mid_nodes[1], !!mid_nodes[2], !!mid_nodes[3] );
>  }
>  
>  MBErrorCode Tqdcfr::read_group(const unsigned int group_index,
> 
> 

-- 
================================================================
"You will keep in perfect peace him whose mind is
   steadfast, because he trusts in you."               Isaiah 26:3

              Tim Tautges            Argonne National Laboratory
          (tautges at mcs.anl.gov)      (telecommuting from UW-Madison)
          phone: (608) 263-8485      1500 Engineering Dr.
            fax: (608) 263-4499      Madison, WI 53706




More information about the moab-dev mailing list