| 93 | // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
| 94 | |
| 95 | bool Foam::fileFormats::STARCDCore::readPoints |
| 96 | ( |
| 97 | IFstream& is, |
| 98 | pointField& points, |
| 99 | labelList& ids |
| 100 | ) |
| 101 | { |
| 102 | if (!is.good()) |
| 103 | { |
| 104 | FatalErrorInFunction |
| 105 | << "Cannot read file " << is.name() |
| 106 | << exit(FatalError); |
| 107 | } |
| 108 | |
| 109 | readHeader(is, "PROSTAR_VERTEX"); |
| 110 | |
| 111 | |
| 112 | // reuse memory if possible |
| 113 | DynamicList<point> dynPoints(points.xfer()); |
| 114 | DynamicList<label> dynPointId(ids.xfer()); // STAR-CD index of points |
| 115 | |
| 116 | dynPoints.clear(); |
| 117 | dynPointId.clear(); |
| 118 | |
| 119 | label lineLabel; |
| 120 | while ((is >> lineLabel).good()) |
| 121 | { |
| 122 | scalar x, y, z; |
| 123 | |
| 124 | is >> x >> y >> z; |
| 125 | |
| 126 | dynPoints.append(point(x, y, z)); |
| 127 | dynPointId.append(lineLabel); |
| 128 | } |
| 129 | |
| 130 | points.transfer(dynPoints); |
| 131 | ids.transfer(dynPointId); |
| 132 | |
| 133 | return true; |
| 134 | } |
| 135 | |
| 136 | |
| 137 | void Foam::fileFormats::STARCDCore::writePoints |