00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef _MBHEXAHEDRONMESHIJK_H
00024 #define _MBHEXAHEDRONMESHIJK_H
00025
00026 #ifdef _WIN32
00027 # pragma warning( push )
00028 # pragma warning(disable:4250)
00029 #endif
00030
00031 #include <MeshVizXLM/mesh/MiVolumeMeshHexahedronIjk.h>
00032 #include <mesh/MbMesh.h>
00033 #include <mesh/MbMeshIjk.h>
00034 #include <topology/MbHexahedronTopologyExplicitIjk.h>
00035 #include <MeshVizXLM/MbVec3.h>
00036
00037 #include <Inventor/STL/vector>
00038 #include <Inventor/STL/iostream>
00039
00072 template <typename _CoordT=MbVec3d, typename _ScalarT=double, typename _Vec3T=MbVec3d, MiMeshIjk::StorageLayout layout = MiMeshIjk::LAYOUT_KJI>
00073 class MbHexahedronMeshIjk : public MiVolumeMeshHexahedronIjk, public MbMesh<_CoordT,_ScalarT,_Vec3T>,
00074 public MbMeshIjk<_ScalarT,_Vec3T,layout>
00075 {
00076
00077 public:
00081 MbHexahedronMeshIjk(size_t numCellI, size_t numCellJ, size_t numCellK) :
00082 m_topology(numCellI,numCellJ,numCellK)
00083 {
00084 }
00088 template <typename _Vec3Iter>
00089 MbHexahedronMeshIjk(size_t numCellI, size_t numCellJ, size_t numCellK,
00090 _Vec3Iter beginCoord, _Vec3Iter endCoord);
00091
00092 const MiHexahedronTopologyExplicitIjk& getTopology() const
00093 {
00094 return m_topology;
00095 }
00096
00100 template <typename _NodeIdIter>
00101 void setCellNodeIndices(size_t i, size_t j, size_t k,
00102 _NodeIdIter beginId, _NodeIdIter endId)
00103 {
00104 m_topology.setCellNodeIndices(i,j,k,beginId,endId);
00105 }
00106
00110 void setDeadCell(size_t i, size_t j, size_t k, bool isDead=true)
00111 {
00112 m_topology.setDeadFlag(i,j,k,isDead);
00113 }
00114
00115 void touch()
00116 {
00117 m_topology.touch();
00118 this->m_geometry.touch();
00119 }
00120
00121 private:
00122 virtual std::ostream& toStream(std::ostream& s) const;
00123
00124 MbHexahedronTopologyExplicitIjk<layout> m_topology;
00125
00126 };
00127
00128
00129
00130 template <typename _CoordT, typename _ScalarT, typename _Vec3T, MiMeshIjk::StorageLayout layout>
00131 template <typename _Vec3Iter>
00132 inline MbHexahedronMeshIjk<_CoordT,_ScalarT,_Vec3T,layout>::MbHexahedronMeshIjk(
00133 size_t numCellI, size_t numCellJ, size_t numCellK,
00134 _Vec3Iter beginCoord, _Vec3Iter endCoord
00135 ) :
00136 MbMesh<_CoordT,_ScalarT,_Vec3T>(beginCoord,endCoord),
00137 m_topology(numCellI,numCellJ,numCellK)
00138 {
00139 }
00140
00141
00142 template <typename _CoordT, typename _ScalarT, typename _Vec3T, MiMeshIjk::StorageLayout layout>
00143 inline std::ostream&
00144 MbHexahedronMeshIjk<_CoordT,_ScalarT,_Vec3T,layout>::toStream(std::ostream& s) const
00145 {
00146 s << "# MbHexahedronMeshIjk" << std::endl;
00147
00148 MiVolumeMeshHexahedronIjk::toStream(s);
00149 MbMesh<_CoordT,_ScalarT,_Vec3T>::toStream(s);
00150 MbMeshIjk<_ScalarT,_Vec3T,layout>::toStream(s);
00151 return s;
00152
00153 }
00154
00155 #ifdef _WIN32
00156 # pragma warning( pop )
00157 #endif
00158
00159 #endif
00160
00161
00162
00163
00164
00165
00166
00167