ABAQUSCore.C
Go to the documentation of this file.
1/*---------------------------------------------------------------------------*\
2 ========= |
3 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4 \\ / O peration |
5 \\ / A nd | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2020 OpenCFD Ltd.
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26\*---------------------------------------------------------------------------*/
27
28#include "ABAQUSCore.H"
29#include "IFstream.H"
30#include "ListOps.H"
31#include "stringOps.H"
32#include "UIListStream.H"
33#include "cellModel.H"
34#include <algorithm>
35#include <cctype>
36
37// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
38
40
41
42// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
43
44namespace Foam
45{
46
47// Use peek(), get(), unget() to detect and skip lines that appear to be
48// "** comment" lines.
49//
50// Uses a mix of std::istream and ISstream methods
51// since we need the low-level get()/unget()
52
53static void skipComments(ISstream& iss)
54{
55 #if OPENFOAM < 2002
56 string line;
57 #endif
58
59 auto& is = iss.stdStream();
60
61 bool isComment = true;
62 while (isComment)
63 {
64 isComment = ('*' == is.peek());
65
66 if (isComment)
67 {
68 // Get and check the next one
69 (void) is.get();
70
71 isComment = ('*' == is.peek());
72 if (isComment)
73 {
74 // Found "** ..." (a comment) - read/discard
75 // ISstream::getLine to keep track of the line numbers
76
77 #if OPENFOAM >= 2002
78 iss.getLine(nullptr);
79 #else
80 iss.getLine(line);
81 #endif
82 }
83 else
84 {
85 // Not a comment
86 // - unget the '*', implicitly break out of loop
87 is.unget();
88 }
89 }
90 }
91}
92
93
94// Get an identifier of the form "NSET=..." (case-insensitive)
95// Return the string on success, an empty string on failure
96
97static string getIdentifier(const word& keyword, string& inputLine)
98{
99 // Strip out whitespace (not a valid Abaqus identifier anyhow)
100 // - makes parsing easier, avoids tab/carriage-returns etc.
101
103
104 // Do string comparisons in upper-case
105
106 const auto key(stringOps::upper(keyword));
107 const auto line(stringOps::upper(inputLine));
108
109 // Extract "..,key=value,key2=value,"
110
111 // Not sure if we need the additional ',' prefix
112 // in search to avoid similar keys.
113
114 auto beg = line.find("," + key + "=");
115
116 if (beg != std::string::npos)
117 {
118 // Skip past the '='
119 beg += key.size() + 2;
120
121 // The closing comma
122 auto len = line.find(',', beg);
123 if (len != std::string::npos)
124 {
125 len -= beg;
126 }
127
128 // Substring from inputLine (not uppercase!)
129 return inputLine.substr(beg, len);
130 }
131
132 // Not found
133 return string();
134}
135
136
137// Walk the string content (CSV format) to append integer labels
138// until the line is exhausted or the list is full.
139//
140// Return false on read error or if the line exhausted while getting
141// element.
142
144(
145 const std::string& line,
146 labelUList& elemNodes,
147 label& nodei
148)
149{
150 const label nNodes = elemNodes.size();
151
152 std::size_t pos = 0;
153
154 while (nodei < nNodes && pos != std::string::npos)
155 {
156 auto beg = pos;
157 auto len = line.find(',', pos);
158
159 if (len == std::string::npos)
160 {
161 pos = len;
162 }
163 else
164 {
165 pos = len + 1;
166 len -= beg;
167 }
168
169 if (readLabel(line.substr(beg, len), elemNodes[nodei]))
170 {
171 ++nodei;
172 }
173 else
174 {
175 // Read error, or need another line
176 return false;
177 }
178 }
179
180 return (nodei >= nNodes);
181}
182
183
184} // End namespace Foam
185
186
187// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
188
191{
192 if (abaqusToFoamFaceAddr_.empty())
193 {
194 abaqusToFoamFaceAddr_.emplace(abaqusTet, labelList({3, 2, 0, 1}));
195 abaqusToFoamFaceAddr_.emplace(abaqusPrism, labelList({0, 1, 4, 3, 2}));
196 abaqusToFoamFaceAddr_.emplace(abaqusHex, labelList({4, 5, 2, 1, 3, 0}));
197 }
198
200}
201
202
204Foam::fileFormats::ABAQUSCore::getElementType(const std::string& elemTypeName)
205{
206 // Check for element-type
207 #undef checkElemType
208 #define checkElemType(test) (elemTypeName.find(test) != std::string::npos)
209
210 if
211 (
212 checkElemType("S3")
213 || checkElemType("CPE3")
214 || checkElemType("2D3")
215 )
216 {
217 return shapeType::abaqusTria;
218 }
219 else if
220 (
221 checkElemType("S4")
222 || checkElemType("CPE4")
223 || checkElemType("2D4")
224 || checkElemType("CPEG4")
225 )
226 {
227 return shapeType::abaqusQuad;
228 }
229 else if
230 (
231 checkElemType("3D4") // C3D4*, Q3D4, ...
232 )
233 {
234 return shapeType::abaqusTet;
235 }
236 else if
237 (
238 checkElemType("3D5") // C3D5*
239 )
240 {
241 return shapeType::abaqusPyr;
242 }
243 else if
244 (
245 checkElemType("3D6") // C3D6*
246 )
247 {
248 return shapeType::abaqusPrism;
249 }
250 else if
251 (
252 checkElemType("3D8") // C3D8*
253 )
254 {
255 return shapeType::abaqusHex;
256 }
257
258 #undef checkElemType
259
260 return shapeType::abaqusUnknownShape;
261}
262
263
264// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
265
266Foam::label
268(
269 const std::string& setName
270)
271{
272 if (elsetMap_.empty())
273 {
274 // Always have a lookup for empty string
275 elsetMap_.set(string::null, 0);
276 }
277
278 if (setName.empty())
279 {
280 return 0;
281 }
282
283 // Direct case-sensitive lookup - it might be there
284
285 label setId = elsetMap_.lookup(setName, -1);
286 if (setId >= 0)
287 {
288 return setId;
289 }
290
291
292 // Case-insensitive search, use upper-case
293
294 const auto needle(stringOps::upper(setName));
295
296 forAllConstIters(elsetMap_, iter)
297 {
298 const auto haystack(stringOps::upper(iter.key()));
299
300 if (needle == haystack)
301 {
302 return iter.val();
303 }
304 }
305
306 // Not there. Save at the next location
307 setId = elsetMap_.size();
308 elsetMap_.set(setName, setId);
309
310 return setId;
311}
312
313
314Foam::label
316(
317 ISstream& is
318)
319{
320 const label initialCount = points_.size();
321
322 char sep; // Comma separator (dummy)
323 string line;
324 label id;
325 point p;
326
327 // Read nodes (points) until next "*Section"
328 while (is.peek() != '*' && is.peek() != EOF)
329 {
330 // Grab the line and wrap as string-stream
331 is.getLine(line);
332 UIListStream ss(line.data(), line.length());
333
334 if (line.empty())
335 {
336 // Not sure if we should terminate on blank lines?
337 continue;
338 }
339
340 // Parse line for ID, X, Y, Z
341 ss >> id >> sep >> p.x() >> sep >> p.y() >> sep >> p.z();
342
343 nodeIds_.append(id);
344 points_.append(p);
345 }
346
347 return (points_.size() - initialCount);
348}
349
350
351Foam::label
353(
354 ISstream& is,
355 const ABAQUSCore::shapeType shape,
356 const label setId
357)
358{
359 // Info<< "*Element" << nl;
360
361 const label nNodes = ABAQUSCore::nPoints(shape);
362
363 if (!nNodes)
364 {
365 return 0;
366 }
367
368 const label initialCount = elemTypes_.size();
369
370 char sep; // Comma separator (dummy)
371 string line;
372 label id;
373
374 labelList elemNodes(nNodes, Zero);
375
376 // Read element connectivity until next "*Section"
377
378 // Parse for ID, node1, node2, ...
379 while (is.peek() != '*' && is.peek() != EOF)
380 {
381 // elemNodes = Zero; for sanity checks?
382
383 is >> id >> sep;
384
385 label nodei = 0;
386 while (nodei < nNodes)
387 {
388 // Grab the rest of the line, walk through CSV fields
389 is.getLine(line);
390
391 appendCsvLabels(line, elemNodes, nodei);
392 }
393
394 // Checks?
395
396 connectivity_.append(elemNodes);
397 elemTypes_.append(shape);
398 elemIds_.append(id);
399 elsetIds_.append(setId);
400 }
401
402 return (elemTypes_.size() - initialCount);
403}
404
405
406Foam::label
408(
409 ISstream& is,
410 const label setId
411)
412{
413 // Info<< "*Surface" << nl;
414
415 // Models for supported solids (need to face mapping)
419
420 // Face mapping from Abaqus cellModel to OpenFOAM cellModel
421 const auto& abqToFoamFaceMap = abaqusToFoamFaceAddr();
422
423 const label initialCount = elemTypes_.size();
424
425 char sep; // Comma separator (dummy)
426 string line;
427 label id;
428
429 // Read until next "*Section"
430
431 // Parse for elemId, sideId.
432 // Eg, "1235, S1"
433 while (is.peek() != '*' && is.peek() != EOF)
434 {
435 is >> id >> sep;
436 is.getLine(line);
437
438 const word sideName(word::validate(stringOps::upper(line)));
439
440 if
441 (
442 sideName.size() != 2
443 || sideName[0] != 'S'
444 || !std::isdigit(sideName[1])
445 )
446 {
447 Info<< "Abaqus reader: unsupported surface element side "
448 << id << ", " << sideName << nl;
449 continue;
450 }
451
452 const label index = elemIds_.find(id);
453 if (id <= 0 || index < 0)
454 {
455 Info<< "Abaqus reader: unsupported surface element "
456 << id << nl;
457 continue;
458 }
459
460 const auto faceIdIter = abqToFoamFaceMap.cfind(elemTypes_[index]);
461 if (!faceIdIter.found())
462 {
463 Info<< "Abaqus reader: reject non-solid shape: " << nl;
464 }
465
466 // The abaqus element side number (1-based)
467 const label sideNum = (sideName[1] - '0');
468
469 const label foamFaceNum = (*faceIdIter)[sideNum - 1];
470
471 const labelList& connect = connectivity_[index];
472
473 // Nodes for the derived shell element
474 labelList elemNodes;
475
476 switch (elemTypes_[index])
477 {
478 case shapeType::abaqusTet:
479 {
480 elemNodes = labelList(connect, tet.modelFaces()[foamFaceNum]);
481 break;
482 }
483 case shapeType::abaqusPrism:
484 {
485 elemNodes = labelList(connect, prism.modelFaces()[foamFaceNum]);
486 break;
487 }
488 case shapeType::abaqusHex:
489 {
490 elemNodes = labelList(connect, hex.modelFaces()[foamFaceNum]);
491 break;
492 }
493 default:
494 break;
495 }
496
497 enum shapeType shape = shapeType::abaqusUnknownShape;
498
499 if (elemNodes.size() == 3)
500 {
501 shape = shapeType::abaqusTria;
502 }
503 else if (elemNodes.size() == 4)
504 {
505 shape = shapeType::abaqusQuad;
506 }
507 else
508 {
509 // Cannot happen
511 << "Could not map face side for "
512 << id << ", " << sideName << nl
513 << exit(FatalError);
514 }
515
516 // Synthesize face Id from solid element Id and side Id
517 const label newElemId = ABAQUSCore::encodeSolidId(id, sideNum);
518
519 // Further checks?
520 connectivity_.append(std::move(elemNodes));
521 elemTypes_.append(shape);
522 elemIds_.append(newElemId);
523 elsetIds_.append(setId);
524 }
525
526 return (elemTypes_.size() - initialCount);
527}
528
529
531(
532 ISstream& is
533)
534{
535 clear();
536
537 label nread;
538 string line;
539
540 while (is.good())
541 {
542 is.getLine(line);
543
544 // Start processing on "*Section-Name",
545 // but skip "** comments" etc
546 if (line[0] != '*' || !std::isalpha(line[1]))
547 {
548 continue;
549 }
550
551 // Some abaqus files use upper-case or mixed-case for section names,
552 // convert all to upper-case for ease.
553
554 const string upperLine(stringOps::upper(line));
555
556 //
557 // "*Nodes" section
558 //
559 if (upperLine.starts_with("*NODE"))
560 {
561 // Ignore "NSET=...", we cannot do anything useful with it
562
563 skipComments(is);
564
565 nread = readPoints(is);
566
567 if (verbose_)
568 {
569 InfoErr
570 << "Read " << nread << " *NODE entries" << nl;
571 }
572 continue;
573 }
574
575 //
576 // "*Element" section
577 //
578 if (upperLine.starts_with("*ELEMENT,"))
579 {
580 // Must have "TYPE=..."
581 const string elemTypeName(getIdentifier("TYPE", line));
582
583 // May have "ELSET=..." on the same line
584 const string elsetName(getIdentifier("ELSET", line));
585
586 const shapeType shape(getElementType(elemTypeName));
587
588 if (!ABAQUSCore::nPoints(shape))
589 {
590 // Unknown/unsupported
591 if (verbose_)
592 {
593 InfoErr
594 << "Ignore abaqus element type: "
595 << elemTypeName << nl;
596 }
597 continue;
598 }
599
600 const label elsetId = addNewElset(elsetName);
601
602 skipComments(is);
603
604 nread = readElements(is, shape, elsetId);
605
606 if (verbose_)
607 {
608 InfoErr
609 << "Read " << nread << " *ELEMENT entries ("
610 << elemTypeName << ") elset="
611 << elsetName << nl;
612 }
613 continue;
614 }
615
616 //
617 // "*Surface" section
618 //
619 if (upperLine.starts_with("*SURFACE,"))
620 {
621 // Require "NAME=..." on the same line
622 const string elsetName(getIdentifier("NAME", line));
623
624 // May have "TYPE=..." on the same line.
625 // If missing, default is ELEMENT.
626 const string surfTypeName(getIdentifier("TYPE", line));
627
628 if
629 (
630 !surfTypeName.empty()
631 && stringOps::upper(surfTypeName) != "ELEMENT"
632 )
633 {
634 Info<< "Reading abaqus surface type "
635 << surfTypeName << " is not implemented" << nl;
636 continue;
637 }
638
639 // Treat like an element set
640 const label elsetId = addNewElset(elsetName);
641
642 skipComments(is);
643
644 nread = readSurfaceElements(is, elsetId);
645
646 if (verbose_)
647 {
648 InfoErr
649 << "Read " << nread << " *SURFACE entries for "
650 << elsetName << nl;
651 }
652 continue;
653 }
654 }
655}
656
657
659{
660 // Negative set
661 bitSet select(elemTypes_.size(), false);
662
663 forAll(elemTypes_, i)
664 {
665 if (!isValidType(elemTypes_[i]) || isSolidType(elemTypes_[i]))
666 {
667 select.set(i);
668 }
669 }
670
671 if (select.any())
672 {
673 select.flip();
674
675 inplaceSubset(select, connectivity_);
676 inplaceSubset(select, elemTypes_);
677
678 inplaceSubset(select, elemIds_);
679 inplaceSubset(select, elsetIds_);
680 }
681}
682
683
685{
686 if (!nodeIds_.empty())
687 {
688 // Has original 1-based ids
689 //
690 // Need to convert to local (0-based) points
691 // in the order in which we read them
692 // and compact unused values
693
694 // Could construct a sort order to preserve the original
695 // point order, but that is not likely relevant for anyone.
696
697
698 // Which original node ids actually being used by elements?
699
700 // We may have many ids, but speculate that they are sparse
701 // and have high element numbers.
702
703 // Use a Map instead of labelList.
704
705 Map<label> nodeIdRemapping(2*points_.size());
706
707 // Pass 1: which nodes are being used?
708
709 for (const labelList& elem : connectivity_)
710 {
711 for (const label origId : elem)
712 {
713 nodeIdRemapping(origId) = 0; // any value
714 }
715 }
716
717 // Define compact local points, finalize the node id remapping
718
719 label nPoints = 0;
720 labelList oldToNewLocal(nodeIds_.size(), -1);
721
722 forAll(nodeIds_, i)
723 {
724 const label origId = nodeIds_[i];
725
726 if (nodeIdRemapping.found(origId))
727 {
728 oldToNewLocal[i] = nPoints;
729 nodeIdRemapping(origId) = nPoints;
730 ++nPoints;
731 }
732 }
733
734 // Prune out -1 values (shrinks list)
735 inplaceReorder(oldToNewLocal, points_, true);
736
737 // Relabel the elements
738
739 for (labelList& elem : connectivity_)
740 {
741 for (label& id : elem)
742 {
743 id = nodeIdRemapping[id];
744 }
745 }
746
747 // Done!
748 nodeIds_.clear();
749 }
750 else
751 {
752 // Already numbered (0-based), but perhaps not compacted
753
754 // Which node ids actually being used by elements?
755 bitSet usedNodeIds(points_.size());
756
757 for (const labelList& elem : connectivity_)
758 {
759 usedNodeIds.set(elem);
760 }
761
762 // Compact the numbers
763 labelList oldToNewLocal = invert(points_.size(), usedNodeIds);
764
765 // Prune out -1 values (shrinks list)
766 inplaceReorder(oldToNewLocal, points_, true);
767
768
769 // Renumber non-compact to compact
770 for (labelList& elem : connectivity_)
771 {
772 inplaceRenumber(oldToNewLocal, elem);
773 }
774 }
775}
776
777
779{
780 for (label& elemId : elemIds_)
781 {
782 renumber0_elemId(elemId);
783 }
784}
785
786
788(
789 Ostream& os,
790 const UList<point>& points,
791 const scalar scaleFactor
792)
793{
794 if (points.empty())
795 {
796 return;
797 }
798
799 // Set the precision of the points data to 10
800 os.precision(10);
801
802 // Force decimal point for Fortran input
803 os.setf(std::ios::showpoint);
804
805 label vertId = 1; // 1-based vertex labels
806
807 os << "*NODE" << nl;
808 for (const point& p : points)
809 {
810 // Convert [m] -> [mm] etc
811 os << " "
812 << vertId << ", "
813 << (scaleFactor * p.x()) << ','
814 << (scaleFactor * p.y()) << ','
815 << (scaleFactor * p.z()) << nl;
816
817 ++vertId;
818 }
819}
820
821
823(
824 const UList<point>& points,
825 const UList<face>& faces,
826 labelList& decompOffsets,
827 DynamicList<face>& decompFaces
828)
829{
830 // On-demand face decomposition (triangulation)
831
832 decompOffsets.resize(faces.size()+1);
833 decompFaces.clear();
834
835 auto offsetIter = decompOffsets.begin();
836 *offsetIter = 0; // The first offset is always zero
837
838 for (const face& f : faces)
839 {
840 const label n = f.size();
841
842 if (n != 3 && n != 4)
843 {
844 // Decompose non-tri/quad into tris
845 f.triangles(points, decompFaces);
846 }
847
848 // The end offset, which is the next begin offset
849 *(++offsetIter) = decompFaces.size();
850 }
851
852 return decompFaces.size();
853}
854
855
856// ************************************************************************* //
static Foam::Map< Foam::labelList > abaqusToFoamFaceAddr_
Definition: ABAQUSCore.C:39
#define checkElemType(test)
Various functions to operate on Lists.
label n
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:72
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
Definition: DynamicListI.H:391
bool found(const Key &key) const
Return true if hashed entry is found in table.
Definition: HashTableI.H:100
void clear()
Clear all entries from table.
Definition: HashTable.C:678
bool good() const noexcept
True if next operation might succeed.
Definition: IOstream.H:233
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:58
virtual std::istream & stdStream()
Access to underlying std::istream.
Definition: ISstream.H:216
int peek()
Raw, low-level peek function.
Definition: ISstreamI.H:70
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
Definition: ISstreamI.H:76
std::enable_if< std::is_same< bool, TypeT >::value, bool >::type set(const label i, bool val=true)
A bitSet::set() method for a list of bool.
Definition: List.H:330
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:139
A HashTable to objects of type <T> with a label key.
Definition: Map.H:60
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
virtual bool read()
Re-read model coefficients if they have changed.
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
Definition: UIListStream.H:205
iterator begin() noexcept
Return an iterator to begin traversing the UList.
Definition: UListI.H:329
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:66
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition: bitSetI.H:590
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:73
const faceList & modelFaces() const noexcept
Return a raw list of model faces.
Definition: cellModelI.H:67
@ PRISM
prism
Definition: cellModel.H:83
reference ref() const
A reference to the entry (Error if not found)
Definition: dictionary.H:225
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:75
static const Map< labelList > & abaqusToFoamFaceAddr()
Face addressing from ABAQUS faces to OpenFOAM faces.
Definition: ABAQUSCore.C:190
static label encodeSolidId(const label id, const label side)
Combine solid element Id and side Id into synthetic face Id.
Definition: ABAQUSCore.H:300
static void writePoints(Ostream &os, const UList< point > &points, const scalar scaleFactor=1.0)
Write '*NODE' header and entries to file, optionally with scaling.
Definition: ABAQUSCore.C:788
static shapeType getElementType(const std::string &elemTypeName)
Definition: ABAQUSCore.C:204
static label faceDecomposition(const UList< point > &points, const UList< face > &faces, labelList &decompOffsets, DynamicList< face > &decompFaces)
Calculate face decomposition for non tri/quad faces.
Definition: ABAQUSCore.C:823
shapeType
Shape-Type - the values are for internal use only!
Definition: ABAQUSCore.H:251
virtual void validate()
Validate the turbulence fields after construction.
Definition: kkLOmega.C:597
A line primitive.
Definition: line.H:68
A class for handling character strings derived from std::string.
Definition: string.H:79
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
Definition: string.H:297
A class for handling words, derived from Foam::string.
Definition: word.H:68
volScalarField & p
patchWriters clear()
const cellModel & hex
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
OBJstream os(runTime.globalPath()/outputName)
const pointField & points
label nPoints
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
Definition: stringOps.C:1200
void inplaceRemoveSpace(std::string &s)
Eliminate whitespace inplace.
Definition: stringOps.C:1074
Namespace for OpenFOAM.
dimensionedScalar pos(const dimensionedScalar &ds)
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
static void skipComments(ISstream &iss)
Definition: ABAQUSCore.C:53
List< label > labelList
A List of labels.
Definition: List.H:66
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition: label.H:66
messageStream Info
Information stream (stdout output on master, null elsewhere)
static string getIdentifier(const word &keyword, string &inputLine)
Definition: ABAQUSCore.C:97
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
static bool appendCsvLabels(const std::string &line, labelUList &elemNodes, label &nodei)
Definition: ABAQUSCore.C:144
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
messageStream InfoErr
Information stream (stderr output on master, null elsewhere)
error FatalError
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Definition: ListOps.C:36
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
constexpr char nl
The newline '\n' character (0x0a)
Definition: Ostream.H:53
labelList f(nPoints)
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:333
#define forAllConstIters(container, iter)
Iterate across all elements of the container object with const access.
Definition: stdFoam.H:278
label readPoints(ISstream &is)
Read entries within a "*Nodes" section.
Definition: ABAQUSCore.C:316
void renumber_elements_1to0()
Renumber elements from 1-based to 0-based.
Definition: ABAQUSCore.C:778
label readElements(ISstream &is, const ABAQUSCore::shapeType shape, const label setId=0)
Read entries within an "*Element" section.
Definition: ABAQUSCore.C:353
void purge_solids()
Remove non-shell elements and compact the points.
Definition: ABAQUSCore.C:658
label readSurfaceElements(ISstream &is, const label setId=0)
Read elements within an "*Surface" section.
Definition: ABAQUSCore.C:408
label addNewElset(const std::string &setName)
Add a new element set name or return an existing one.
Definition: ABAQUSCore.C:268
void compact_nodes()
Compact unused points and relabel connectivity.
Definition: ABAQUSCore.C:684