UnitTestBoxMeshFixture.hpp

00001 /*------------------------------------------------------------------------*/
00002 /*                 Copyright 2010 Sandia Corporation.                     */
00003 /*  Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive   */
00004 /*  license for use of this work by or on behalf of the U.S. Government.  */
00005 /*  Export of this program may require a license from the                 */
00006 /*  United States Government.                                             */
00007 /*------------------------------------------------------------------------*/
00008 
00009 #ifndef STK_MESH_UNITTEST_BOX_MESH_FIXTURE_HPP
00010 #define STK_MESH_UNITTEST_BOX_MESH_FIXTURE_HPP
00011 
00012 #include <stk_mesh/base/Types.hpp>
00013 #include <stk_util/parallel/Parallel.hpp>
00014 
00015 #include <stk_mesh/base/MetaData.hpp>
00016 #include <stk_mesh/base/BulkData.hpp>
00017 #include <stk_mesh/base/Field.hpp>
00018 
00019 #include <stk_mesh/fem/EntityTypes.hpp>
00020 #include <stk_mesh/fem/FieldTraits.hpp>
00021 #include <stk_mesh/fem/TopologyDimensions.hpp>
00022 #include <stk_mesh/fem/TopologyHelpers.hpp>
00023     
00024 #include <Shards_BasicTopologies.hpp>
00025 #include <stk_mesh/base/DataTraits.hpp>
00026 
00027 class BoxMeshFixture
00028 {
00029 public:
00030   typedef int Scalar ;
00031   typedef stk::mesh::Field<Scalar, stk::mesh::Cartesian>     CoordFieldType;
00032   typedef stk::mesh::Field<Scalar*,stk::mesh::ElementNode>   CoordGatherFieldType;
00033   typedef stk::mesh::Field<Scalar*,stk::mesh::QuadratureTag> QuadFieldType;
00034   typedef stk::mesh::Field<Scalar*,stk::mesh::BasisTag>      BasisFieldType;
00035 
00036   BoxMeshFixture(stk::ParallelMachine pm);
00037 
00038   void fill_mesh();
00039 
00040   ~BoxMeshFixture();
00041 
00042   stk::mesh::MetaData    m_meta_data ;
00043   stk::mesh::BulkData    m_bulk_data ;
00044   stk::mesh::Part      & m_elem_block ;
00045   CoordFieldType       & m_coord_field ;
00046   CoordGatherFieldType & m_coord_gather_field ;
00047   QuadFieldType        & m_quad_field ;
00048   BasisFieldType       & m_basis_field ;
00049 
00050   //  Box of 8 elements:
00051   //  Up to 8 processes, so each process owns at least one element.
00052   //  Then the automatic ghosting will fully populate the nodes and elements.
00053 
00054   stk::mesh::Entity * m_nodes[3][3][3] ;
00055   stk::mesh::Entity * m_elems[2][2][2] ;
00056   stk::mesh::EntityId m_node_id[3][3][3] ;
00057   Scalar              m_node_coord[3][3][3][3] ;
00058 
00059 private:
00060   BoxMeshFixture( const BoxMeshFixture & );
00061   BoxMeshFixture & operator = ( const BoxMeshFixture & );
00062 };
00063 
00064 #endif
00065 

Generated on Tue Jul 13 09:27:32 2010 for Sierra Toolkit by  doxygen 1.4.7