40 namespace surfaceWriters
72 for (
const label vert : elem)
74 os <<
", " << (vert + 1);
85 void Foam::surfaceWriters::abaqusWriter::writeFace
98 os <<
"*ELEMENT, TYPE=S" <<
f.size();
102 os <<
", ELSET=_" << propId;
112 void Foam::surfaceWriters::abaqusWriter::writeGeometry
115 const meshedSurf& surf,
117 DynamicList<face>& decompFaces
121 const faceList& faces = surf.faces();
123 const labelList& elemIds = surf.faceIds();
126 bool useOrigFaceIds =
128 elemIds.size() == faces.size()
135 for (
const auto&
f : faces)
139 useOrigFaceIds =
false;
146 os <<
"** Geometry" <<
nl;
157 decompOffsets.resize(faces.size()+1);
160 decompOffsets[0] = 0;
172 const face&
f = faces[facei];
177 elemId = elemIds[facei];
181 const label propId = 1 + (facei < zones.size() ? zones[facei] : 0);
183 const label
n =
f.size();
186 (prevOutput.first() !=
n || prevOutput.second() != propId);
191 prevOutput.first() =
n;
192 prevOutput.second() = propId;
195 if (
n == 3 ||
n == 4)
197 writeFace(
os,
f, ++elemId, propId, header);
202 prevOutput.first() = 3;
204 f.triangles(
points, decompFaces);
208 label decompi = decompOffsets[facei];
209 decompi < decompFaces.size();
216 decompFaces[decompi],
227 decompOffsets[facei+1] = decompFaces.size();
241 outputLayout_(outputLayoutType::BY_FIELD)
251 noGeometry_(options.getOrDefault(
"noGeometry", false)),
252 outputLayout_(outputLayoutType::BY_FIELD)
266 open(surf, outputPath, parallel);
281 open(
points, faces, outputPath, parallel);
297 switch (outputLayout_)
299 case outputLayoutType::BY_TIME:
301 outputFile = outputPath_;
302 if (useTimeDir() && !
timeName().empty())
310 case outputLayoutType::BY_FIELD:
312 outputFile = outputPath_ /
"geometry" / outputPath_.
name();
321 outputFile.
ext(
"abq");
325 Info<<
"Writing abaqus geometry to " << outputFile <<
endl;
330 const meshedSurfRef& surf = adjustSurface();
339 OFstream
os(outputFile);
342 DynamicList<face> decompFaces;
A class for handling file names.
A list of keyword definitions, which are a keyword followed by a number of values (eg...
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
constexpr char nl
The newline '\n' character (0x0a)
Ostream & endl(Ostream &os)
Add newline and flush stream.
static std::string path(const std::string &str)
Return directory path name (part before last /)
word ext() const
Return file name extension (part after last .)
Macros for easy insertion into run-time selection tables.
UList< label > labelUList
A UList of labels.
Abstract definition of a meshed surface defined by faces and points.
Various functions to operate on Lists.
#define forAll(list, i)
Loop across all elements in list.
abaqusWriter()
Default construct.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
List< face > faceList
List of faces.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
vectorField pointField
pointField is a vectorField.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
A class for handling words, derived from Foam::string.
defineSurfaceWriterWriteFields(Foam::surfaceWriters::abaqusWriter)
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Istream and Ostream manipulators taking arguments.
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Pair< label > labelPair
A pair of labels.
OBJstream os(runTime.globalPath()/outputName)
static void writeConnectivity(Ostream &os, const label elemId, const labelUList &elem)
Convenience macros for instantiating surfaceWriter methods.
defineTypeName(abaqusWriter)
A surface writer for the ABAQUS file format - both surface mesh and fields.
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
messageStream Info
Information stream (stdout output on master, null elsewhere)
virtual fileName write()
Write surface geometry to file.
Base class for surface writers.
List< label > labelList
A List of labels.
addToRunTimeSelectionTable(surfaceWriter, abaqusWriter, word)