block.C
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
00030 #include "error.H"
00031
00032 #include "block.H"
00033
00034
00035
00036 namespace Foam
00037 {
00038
00039
00040
00041
00042 label block::vtxLabel(label a, label b, label c)
00043 {
00044 return (a + b*(BlockDef.xDim() + 1)
00045 + c*(BlockDef.xDim() + 1)*(BlockDef.yDim() + 1));
00046 }
00047
00048
00049
00050
00051 block::block(const blockDescriptor& definition)
00052 :
00053 BlockDef(definition),
00054 Vertices
00055 (
00056 ((BlockDef.xDim() + 1)*(BlockDef.yDim() + 1)*(BlockDef.zDim() + 1))
00057 ),
00058 Cells
00059 (
00060 (BlockDef.xDim()*BlockDef.yDim()*BlockDef.zDim())
00061 ),
00062 BoundaryPatches(6)
00063 {
00064
00065 blockPoints();
00066
00067
00068 blockCells();
00069
00070
00071 blockBoundary();
00072 }
00073
00074
00075 block::block(const block& original)
00076 :
00077 BlockDef(original.blockDef()),
00078 Vertices(original.points()),
00079 Cells(original.cells()),
00080 BoundaryPatches(original.boundaryPatches())
00081 {}
00082
00083
00084
00085
00086 block::~block()
00087 {}
00088
00089
00090
00091
00092
00093 const blockDescriptor& block::blockDef() const
00094 {
00095 return BlockDef;
00096 }
00097
00098 const pointField& block::points() const
00099 {
00100 return Vertices;
00101 }
00102
00103 const labelListList& block::cells() const
00104 {
00105 return Cells;
00106 }
00107
00108 const labelListListList& block::boundaryPatches() const
00109 {
00110 return BoundaryPatches;
00111 }
00112
00113
00114
00115
00116 Ostream& operator<<(Ostream& os, const block& b)
00117 {
00118 os << b.Vertices << nl
00119 << b.Cells << nl
00120 << b.BoundaryPatches << endl;
00121
00122 return os;
00123 }
00124
00125
00126
00127
00128 }
00129
00130
00131
Copyright © 2000-2009 OpenCFD Ltd