Go to the documentation of this file.
34 #undef Foam_readAbaqusSurface
60 bool isComment =
true;
63 isComment = (
'*' == is.
peek());
70 isComment = (
'*' == is.
peek());
113 auto beg =
line.find(
"," + key +
"=");
115 if (beg != std::string::npos)
118 beg += key.size() + 2;
121 auto len =
line.find(
',', beg);
122 if (len != std::string::npos)
128 return inputLine.substr(beg, len);
144 const std::string&
line,
149 const label nNodes = elemNodes.
size();
153 while (nodei < nNodes &&
pos != std::string::npos)
156 auto len =
line.find(
',',
pos);
158 if (len == std::string::npos)
179 return (nodei >= nNodes);
207 #define checkElemType(test) (elemTypeName.find(test) != std::string::npos)
216 return shapeType::abaqusTria;
226 return shapeType::abaqusQuad;
233 return shapeType::abaqusTet;
240 return shapeType::abaqusPyr;
247 return shapeType::abaqusPrism;
254 return shapeType::abaqusHex;
259 return shapeType::abaqusUnknownShape;
268 const std::string& setName
271 if (elsetMap_.empty())
284 label setId = elsetMap_.lookup(setName, -1);
299 if (needle == haystack)
306 setId = elsetMap_.size();
307 elsetMap_.set(setName, setId);
319 const label initialCount = points_.size();
328 while (is.
peek() !=
'*' && is.
peek() != EOF)
341 ss >>
id >> sep >>
p.x() >> sep >>
p.y() >> sep >>
p.z();
347 return (points_.size() - initialCount);
368 const label initialCount = elemTypes_.size();
379 while (is.
peek() !=
'*' && is.
peek() != EOF)
386 while (nodei < nNodes)
396 connectivity_.append(elemNodes);
397 elemTypes_.append(shape);
399 elsetIds_.append(setId);
402 return (elemTypes_.size() - initialCount);
422 if (
line[0] !=
'*' || !std::isalpha(
line[1]))
439 nread = readPoints(is);
444 <<
"Read " << nread <<
" *NODE entries" <<
nl;
458 const shapeType shape(getElementType(elemTypeName));
466 <<
"Ignore abaqus element type: "
467 << elemTypeName <<
nl;
472 const label elsetId = addNewElset(elsetName);
476 nread = readElements(is, shape, elsetId);
481 <<
"Read " << nread <<
" *ELEMENT entries ("
482 << elemTypeName <<
") elset="
492 #ifdef Foam_readAbaqusSurface
497 Info<<
"Reading of abaqus surfaces not implemented" <<
nl;
509 bitSet select(elemTypes_.size(),
false);
513 if (!isValidType(elemTypes_[i]) || isSolidType(elemTypes_[i]))
534 if (!nodeIds_.empty())
557 for (
const labelList& elem : connectivity_)
559 for (
const label origId : elem)
561 nodeIdRemapping(origId) = 0;
568 labelList oldToNewLocal(nodeIds_.size(), -1);
572 const label origId = nodeIds_[i];
574 if (nodeIdRemapping.found(origId))
577 nodeIdRemapping(origId) =
nPoints;
589 for (label&
id : elem)
591 id = nodeIdRemapping[id];
603 bitSet usedNodeIds(points_.size());
605 for (
const labelList& elem : connectivity_)
607 usedNodeIds.
set(elem);
630 const scalar scaleFactor
642 os.
setf(std::ios::showpoint);
652 << (scaleFactor *
p.x()) <<
','
653 << (scaleFactor *
p.y()) <<
','
654 << (scaleFactor *
p.z()) <<
nl;
674 auto offsetIter = decompOffsets.begin();
677 for (
const face&
f : faces)
679 const label
n =
f.size();
681 if (
n != 3 &&
n != 4)
684 f.triangles(
points, decompFaces);
688 *(++offsetIter) = decompFaces.size();
691 return decompFaces.size();
List< label > labelList
A List of labels.
int peek()
Raw, low-level peek function.
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
A class for handling words, derived from Foam::string.
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
static constexpr const zero Zero
Global zero (0)
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
Generic input stream using a standard (STL) stream.
void set(const bitSet &bitset)
Set specified bits from another bitset.
A HashTable to objects of type <T> with a label key.
A class for handling character strings derived from std::string.
messageStream InfoErr
Information stream (uses stderr - output is on the master only)
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
virtual int precision() const =0
Get precision of output field.
#define forAll(list, i)
Loop across all elements in list.
ISstream & get(char &c)
Raw, low-level get character function.
static string getIdentifier(const word &keyword, string &inputLine)
messageStream Info
Information stream (uses stdout - output is on the master only)
static Foam::Map< Foam::labelList > abaqusToFoamFaceAddr_
void clear()
Clear the addressed list, i.e. set the size to zero.
#define checkElemType(test)
void resize(const label newSize)
Adjust allocated size of list.
static const string null
An empty string.
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
ios_base::fmtflags setf(const ios_base::fmtflags f)
Set flags of stream.
virtual std::istream & stdStream()
Access to underlying std::istream.
forAllConstIters(mixture.phases(), phase)
void inplaceRemoveSpace(std::string &s)
Eliminate whitespace inplace.
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
static bool appendCsvLabels(const std::string &line, labelUList &elemNodes, label &nodei)
void size(const label n) noexcept
Override size to be inconsistent with allocated storage.
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
A face is a list of labels corresponding to mesh vertices.
Various functions to operate on Lists.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
bool good() const
Return true if next operation might succeed.
static void skipComments(ISstream &iss)
dimensionedScalar pos(const dimensionedScalar &ds)