Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 #include <OpenFOAM/error.H>
00030 
00031 #include "block.H"
00032 
00033 
00034 
00035 namespace Foam
00036 {
00037 
00038 
00039 
00040 
00041 label block::vtxLabel(label a, label b, label c)
00042 {
00043     return (a + b*(BlockDef.xDim() + 1)
00044             + c*(BlockDef.xDim() + 1)*(BlockDef.yDim() + 1));
00045 }
00046 
00047 
00048 
00049 
00050 block::block(const blockDescriptor& definition)
00051 :
00052     BlockDef(definition),
00053     Vertices
00054     (
00055         ((BlockDef.xDim() + 1)*(BlockDef.yDim() + 1)*(BlockDef.zDim() + 1))
00056     ),
00057     Cells
00058     (
00059         (BlockDef.xDim()*BlockDef.yDim()*BlockDef.zDim())
00060     ),
00061     BoundaryPatches(6)
00062 {
00063     
00064     blockPoints();
00065 
00066     
00067     blockCells();
00068 
00069     
00070     blockBoundary();
00071 }
00072 
00073 
00074 block::block(const block& original)
00075 :
00076     BlockDef(original.blockDef()),
00077     Vertices(original.points()),
00078     Cells(original.cells()),
00079     BoundaryPatches(original.boundaryPatches())
00080 {}
00081 
00082 
00083 
00084 
00085 block::~block()
00086 {}
00087 
00088 
00089 
00090 
00091 
00092 const blockDescriptor& block::blockDef() const
00093 {
00094     return BlockDef;
00095 }
00096 
00097 const pointField& block::points() const
00098 {
00099     return Vertices;
00100 }
00101 
00102 const labelListList& block::cells() const
00103 {
00104     return Cells;
00105 }
00106 
00107 const labelListListList& block::boundaryPatches() const
00108 {
00109     return BoundaryPatches;
00110 }
00111 
00112 
00113 
00114 
00115 Ostream& operator<<(Ostream& os, const block& b)
00116 {
00117     os << b.Vertices << nl
00118        << b.Cells << nl
00119        << b.BoundaryPatches << endl;
00120 
00121     return os;
00122 }
00123 
00124 
00125 
00126 
00127 } 
00128 
00129 
00130