42 bool Foam::triSurface::readTRI(
const fileName& TRIfileName)
44 IFstream TRIfile(TRIfileName);
49 <<
"Cannot read file " << TRIfileName
53 SLList<STLpoint> STLpoints;
54 SLList<label> STLlabels;
55 HashTable<label, string> STLsolidNames;
62 string line = getLineNoComment(TRIfile);
69 IStringStream lineStream(line);
78 if (!lineStream)
break;
105 word rawSolidName(lineStream);
107 word solidName(
"patch" + rawSolidName(1, rawSolidName.size()-1));
112 STLsolidNames.find(solidName);
114 if (fnd != STLsolidNames.end())
120 Pout<<
"Mapping triangle colour 0" << rawSolidName
121 <<
" to region " << maxRegion <<
" name " << solidName
124 region = maxRegion++;
125 STLsolidNames.insert(solidName, region);
127 STLlabels.append(region);
136 rawPoints[pointi++] = *iter;
161 patches_.
setSize(names.size());
165 patches_[nameI].name() = names[nameI];
166 patches_[nameI].geometricType() =
"empty";
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
errorManipArg< error, int > exit(error &err, const int errNo=1)
T & operator[](const label)
Return element of UList.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Read a hex label from an input stream.
Ostream & endl(Ostream &os)
Add newline and flush stream.
vectorField pointField
pointField is a vectorField.
friend class const_iterator
Declare friendship with the const_iterator.
bool readScalar(const char *buf, doubleScalar &s)
Read whole of buf as a scalar. Return true if successful.
forAllConstIter(PtrDictionary< phaseModel >, mixture.phases(), phase)
pointField & storedPoints()
Non-const access to global points.
friend class const_iterator
List< string > stringList
A List of strings.
void setSize(const label)
Reset size of List.
prefixOSstream Pout(cout, "Pout")
Non-intrusive singly-linked list.
void transfer(List< T > &)
Transfer the contents of the argument List into this list.