|
Sierra Toolkit Version of the Day
|
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_TopologyHelpersDeprecated_hpp 00010 #define stk_mesh_TopologyHelpersDeprecated_hpp 00011 00012 #ifndef SKIP_DEPRECATED_STK_MESH_TOPOLOGY_HELPERS 00013 00014 // Migration to new Finite Element Mesh Cell Topology 00015 // 00016 // To turn off all the deprecated code: 00017 // * Enable the following ifdef: SKIP_DEPRECATED_STK_MESH_TOPOLOGY_HELPERS 00018 // * This can be enabled in Sierra with the following bake command: 00019 // bake stk_mesh -- cxxflags="-DSKIP_DEPRECATED_STK_MESH_TOPOLOGY_HELPERS" 00020 // 00021 // Wherever you call set_cell_topology: 00022 // * #include<stk_mesh/fem/TopologicalMetaData.hpp> 00023 // * Instantiate a TopologicalMetaData with MetaData and the spatial dimension 00024 // * Call TopologicalMetaData.declare_part<shards::CELL_TOPOLOGY>("name") 00025 // which will declare the part and set the cell topology. 00026 // Wherever you call get_cell_topology(...): 00027 // * Call the static function: TopologicalMetaData::get_cell_topology(...) 00028 // Wherever you #include<stk_mesh/fem/FieldDeclarations.hpp>, 00029 // * Copy these functions out into your own application and stop #including this file 00030 // Wherever you #include<stk_mesh/fem/FieldTraits.hpp> (note: fem, NOT base): 00031 // * Change the #include to #include<stk_mesh/fem/CoordinateSystems.hpp> 00032 // 00033 00034 // Note the following information about the changes: 00035 // * EntityRank has been changed from a compile time enum to a runtime 00036 // value. 00037 // * Part rank consistency with cell topology dimension is now enforced at 00038 // construction. 00039 // * TopologyHelpers used to provide set_cell_topology and 00040 // get_cell_topology. These are now provided by TopologicalMetaData. 00041 // * The mechanism for storing cell topology on parts has changed. 00042 // Previously, the cell topology was stored on each part. Now it is stored 00043 // as a map in the TopologicalMetaData which is stored as an attribute on 00044 // MetaData. 00045 // * Previously, get_cell_topology was a free function, it is now a static 00046 // function on TopologicalMetaData. 00047 // * Previously, set_cell_topology was a free function, it is now a regular 00048 // member function on TopologicalMetaData, which means you'll have to create 00049 // one of these objects in order to set cell topology on a part. 00050 // * Previously, cell topologies were set on parts after the part was 00051 // declared. Now, you must construct a part with a cell topology through 00052 // TopologicalMetaData. 00053 // * stk_mesh/fem/FieldDeclarations.hpp is now deprecated due to its tight 00054 // coupling to specific application domains. If you use any of these 00055 // functions, we advise you to copy them out into your own application 00056 // namespace. They are very simple convenience wrappers around 00057 // stk::mesh::put_field. 00058 // * stk_mesh/fem/FieldTraits.hpp is changing name to 00059 // stk_mesh/fem/CoordinateSystems.hpp and the FieldTraits file will remain 00060 // for one Trilinos release. 00061 // * Note: The Trilinos release after 10.6, presumably 10.8, mark when we 00062 // will delete the deprecated functionality. 00063 // stk_mesh/fem/FieldDeclarations.hpp and stk_mesh/fem/FieldTraits.hpp will 00064 // also be removed at this time. 00065 00066 #include <sstream> 00067 #include <stdexcept> 00068 #include <Shards_CellTopologyTraits.hpp> 00069 #include <stk_mesh/base/Types.hpp> 00070 #include <stk_mesh/fem/EntityRanks.hpp> 00071 #include <stk_mesh/base/BulkData.hpp> 00072 #include <stk_mesh/fem/TopologicalMetaData.hpp> 00073 00074 00075 namespace stk { 00076 namespace mesh { 00077 00078 00083 //---------------------------------------------------------------------- 00087 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00088 void set_cell_topology_deprecated( Part & , const CellTopologyData * singleton ); 00089 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00090 void set_cell_topology( Part & , const CellTopologyData * singleton ); 00091 00095 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00096 template< class Traits > 00097 void set_cell_topology_deprecated( Part & p ) 00098 { return set_cell_topology_deprecated( p , shards::getCellTopologyData<Traits>() ); } 00099 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00100 template< class Traits > 00101 void set_cell_topology( Part & p ) 00102 { return set_cell_topology( p , shards::getCellTopologyData<Traits>() ); } 00103 00105 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00106 const CellTopologyData * get_cell_topology_deprecated( const Part & ); 00107 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00108 const CellTopologyData * get_cell_topology( const Part & ); 00109 00111 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00112 const CellTopologyData * get_cell_topology_deprecated( const Bucket & ); 00113 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00114 const CellTopologyData * get_cell_topology( const Bucket & ); 00115 00117 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00118 const CellTopologyData * get_cell_topology_deprecated( const Entity & ); 00119 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00120 const CellTopologyData * get_cell_topology( const Entity & ); 00121 00122 // DEPRECATED: 09/15/10 FEM TopologicalMetaData refactor 00123 inline 00124 EntityRank element_rank_deprecated(const MetaData & meta) 00125 { 00126 const TopologicalMetaData * top_data = meta.get_attribute< TopologicalMetaData >(); 00127 return (top_data == NULL) ? (stk::mesh::Element) : (top_data->element_rank); 00128 } 00129 00133 }//namespace mesh 00134 }//namespace stk 00135 00136 #endif // SKIP_DEPRECATED_STK_MESH_TOPOLOGY_HELPERS 00137 00138 #endif // stk_mesh_TopologyHelpersDeprecated_hpp 00139