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 -------------------------------------------------------------------------------
10 License
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 
44 namespace 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 
53 static 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 
97 static 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 
143 static bool appendCsvLabels
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 
199  return abaqusToFoamFaceAddr_;
200 }
201 
202 
204 Foam::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 
266 Foam::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 
314 Foam::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 
351 Foam::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 
406 Foam::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)
417  const cellModel& prism = cellModel::ref(cellModel::PRISM);
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 // ************************************************************************* //
Foam::fileFormats::ABAQUSCore::readHelper::readElements
label readElements(ISstream &is, const ABAQUSCore::shapeType shape, const label setId=0)
Read entries within an "*Element" section.
Definition: ABAQUSCore.C:353
Foam::labelList
List< label > labelList
A List of labels.
Definition: List.H:67
Foam::ISstream::peek
int peek()
Raw, low-level peek function.
Definition: ISstreamI.H:70
Foam::fileFormats::ABAQUSCore::readHelper::addNewElset
label addNewElset(const std::string &setName)
Add a new element set name or return an existing one.
Definition: ABAQUSCore.C:268
Foam::UIListStream
Similar to IStringStream but using an externally managed buffer for its input. This allows the input ...
Definition: UIListStream.H:201
p
volScalarField & p
Definition: createFieldRefs.H:8
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::ISstream::getLine
ISstream & getLine(std::string &str, char delim='\n')
Raw, low-level getline (until delimiter) into a string.
Definition: ISstreamI.H:76
Foam::bitSet
A bitSet stores bits (elements with only two states) in packed internal format and supports a variety...
Definition: bitSet.H:63
Foam::List::resize
void resize(const label len)
Adjust allocated size of list.
Definition: ListI.H:139
Foam::Zero
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
Foam::DynamicList
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects.
Definition: DynamicList.H:55
Foam::string::starts_with
bool starts_with(const std::string &s) const
True if string starts with the given prefix (cf. C++20)
Definition: string.H:297
Foam::cellModel::HEX
hex
Definition: cellModel.H:81
Foam::glTF::key
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Definition: foamGltfBase.H:108
Foam::ISstream
Generic input stream using a standard (STL) stream.
Definition: ISstream.H:55
Foam::fileFormats::ABAQUSCore::readHelper::read
void read(ISstream &is)
Read an abaqus input file.
Definition: ABAQUSCore.C:531
Foam::bitSet::set
void set(const bitSet &bitset)
Set specified bits from another bitset.
Definition: bitSetI.H:574
Foam::Map
A HashTable to objects of type <T> with a label key.
Definition: lumpedPointController.H:69
Foam::word::validate
static word validate(const std::string &s, const bool prefix=false)
Construct validated word (no invalid characters).
Definition: word.C:45
Foam::string
A class for handling character strings derived from std::string.
Definition: string.H:76
Foam::InfoErr
messageStream InfoErr
Information stream (stderr output on master, null elsewhere)
Foam::DynamicList::clear
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
Definition: DynamicListI.H:391
Foam::invert
labelList invert(const label len, const labelUList &map)
Create an inverse one-to-one mapping.
Definition: ListOps.C:36
Foam::cellModel::TET
tet
Definition: cellModel.H:85
Foam::inplaceRenumber
void inplaceRenumber(const labelUList &oldToNew, IntListType &input)
Inplace renumber the values (not the indices) of a list.
Definition: ListOpsTemplates.C:61
forAll
#define forAll(list, i)
Loop across all elements in list.
Definition: stdFoam.H:296
Foam::IOstream::good
bool good() const noexcept
True if next operation might succeed.
Definition: IOstream.H:233
Foam::ISstream::get
ISstream & get(char &c)
Raw, low-level get character function.
Definition: ISstreamI.H:56
nPoints
label nPoints
Definition: gmvOutputHeader.H:2
Foam::fileFormats::ABAQUSCore::encodeSolidId
static label encodeSolidId(const label id, const label side)
Combine solid element Id and side Id into synthetic face Id.
Definition: ABAQUSCore.H:300
Foam::fileFormats::ABAQUSCore::readHelper::compact_nodes
void compact_nodes()
Compact unused points and relabel connectivity.
Definition: ABAQUSCore.C:684
n
label n
Definition: TABSMDCalcMethod2.H:31
Foam::fileFormats::ABAQUSCore::getElementType
static shapeType getElementType(const std::string &elemTypeName)
Definition: ABAQUSCore.C:204
Foam::fileFormats::ABAQUSCore::readHelper::readPoints
label readPoints(ISstream &is)
Read entries within a "*Nodes" section.
Definition: ABAQUSCore.C:316
Foam::getIdentifier
static string getIdentifier(const word &keyword, string &inputLine)
Definition: ABAQUSCore.C:97
cellModel.H
Foam::Info
messageStream Info
Information stream (stdout output on master, null elsewhere)
Foam::fileFormats::ABAQUSCore::abaqusPrism
Definition: ABAQUSCore.H:257
abaqusToFoamFaceAddr_
static Foam::Map< Foam::labelList > abaqusToFoamFaceAddr_
Definition: ABAQUSCore.C:39
UIListStream.H
Foam::fileFormats::ABAQUSCore::nPoints
static int nPoints(shapeType tag)
The number of points associated with the element type.
Definition: ABAQUSCore.H:270
Foam::fileFormats::ABAQUSCore::faceDecomposition
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
Foam::cellModel::PRISM
prism
Definition: cellModel.H:83
Foam::fileFormats::ABAQUSCore::abaqusToFoamFaceAddr
static const Map< labelList > & abaqusToFoamFaceAddr()
Face addressing from ABAQUS faces to OpenFOAM faces.
Definition: ABAQUSCore.C:190
Foam::cellModel::ref
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
Definition: cellModels.C:157
checkElemType
#define checkElemType(test)
IFstream.H
Foam::FatalError
error FatalError
Foam::string::null
static const string null
An empty string.
Definition: string.H:169
os
OBJstream os(runTime.globalPath()/outputName)
Foam::fileFormats::ABAQUSCore::abaqusHex
Definition: ABAQUSCore.H:258
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::inplaceSubset
void inplaceSubset(const BoolListType &select, ListType &input, const bool invert=false)
Inplace extract elements of the input list when select is true.
Definition: ListOpsTemplates.C:583
Foam::exit
errorManipArg< error, int > exit(error &err, const int errNo=1)
Definition: errorManip.H:130
Foam::hex
IOstream & hex(IOstream &io)
Definition: IOstream.H:446
Foam::fileFormats::ABAQUSCore::readHelper::purge_solids
void purge_solids()
Remove non-shell elements and compact the points.
Definition: ABAQUSCore.C:658
Foam::fileFormats::ABAQUSCore::abaqusTet
Definition: ABAQUSCore.H:255
Foam::ISstream::stdStream
virtual std::istream & stdStream()
Access to underlying std::istream.
Definition: ISstream.H:216
Foam::fileFormats::ABAQUSCore::readHelper::renumber_elements_1to0
void renumber_elements_1to0()
Renumber elements from 1-based to 0-based.
Definition: ABAQUSCore.C:778
FatalErrorInFunction
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
Definition: error.H:453
clear
patchWriters clear()
Foam::nl
constexpr char nl
Definition: Ostream.H:404
forAllConstIters
forAllConstIters(mixture.phases(), phase)
Definition: pEqn.H:28
Foam::stringOps::inplaceRemoveSpace
void inplaceRemoveSpace(std::string &s)
Eliminate whitespace inplace.
Definition: stringOps.C:1074
f
labelList f(nPoints)
Foam::Vector< scalar >
Foam::readLabel
label readLabel(const char *buf)
Parse entire buffer as a label, skipping leading/trailing whitespace.
Definition: label.H:66
Foam::appendCsvLabels
static bool appendCsvLabels(const std::string &line, labelUList &elemNodes, label &nodei)
Definition: ABAQUSCore.C:144
Foam::List< label >
Foam::fileFormats::ABAQUSCore::shapeType
shapeType
Shape-Type - the values are for internal use only!
Definition: ABAQUSCore.H:250
Foam::UList< label >
points
const pointField & points
Definition: gmvOutputHeader.H:1
Foam::fileFormats::ABAQUSCore::readHelper::readSurfaceElements
label readSurfaceElements(ISstream &is, const label setId=0)
Read elements within an "*Surface" section.
Definition: ABAQUSCore.C:408
Foam::line
A line primitive.
Definition: line.H:53
Foam::cellModel::modelFaces
const faceList & modelFaces() const noexcept
Return a raw list of model faces.
Definition: cellModelI.H:67
ABAQUSCore.H
Foam::inplaceReorder
void inplaceReorder(const labelUList &oldToNew, ListType &input, const bool prune=false)
Inplace reorder the elements of a list.
Definition: ListOpsTemplates.C:124
Foam::face
A face is a list of labels corresponding to mesh vertices.
Definition: face.H:72
ListOps.H
Various functions to operate on Lists.
Foam::cellModel
Maps a geometry to a set of cell primitives.
Definition: cellModel.H:72
Foam::UList::size
void size(const label n)
Older name for setAddressableSize.
Definition: UList.H:114
Foam::fileFormats::ABAQUSCore::writePoints
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
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::stringOps::upper
string upper(const std::string &s)
Return string copy transformed with std::toupper on each character.
Definition: stringOps.C:1200
stringOps.H
Foam::skipComments
static void skipComments(ISstream &iss)
Definition: ABAQUSCore.C:53
Foam::pos
dimensionedScalar pos(const dimensionedScalar &ds)
Definition: dimensionedScalar.C:177