72 for (
const label vert : elem)
74 os <<
", " << (vert + 1);
85void Foam::surfaceWriters::abaqusWriter::writeFace
98 os <<
"*ELEMENT, TYPE=S" <<
f.size();
102 os <<
", ELSET=_" << propId;
112void 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);
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;
Istream and Ostream manipulators taking arguments.
Various functions to operate on Lists.
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
Macros for easy insertion into run-time selection tables.
#define addToRunTimeSelectionTable(baseType, thisType, argNames)
Add to construction table with typeName as the key.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
static bool master(const label communicator=worldComm)
True if process corresponds to the master rank in the communicator.
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
A class for handling file names.
word ext() const
Return file name extension (part after last .).
static std::string path(const std::string &str)
Return directory path name (part before last /).
static std::string name(const std::string &str)
Return basename (part beyond last /), including its extension.
Abstract definition of a meshed surface defined by faces and points.
Base class for surface writers.
surfaceWriter()
Default construct.
virtual void open(const fileName &outputPath)
Open for output on specified path, using existing surface.
A surface writer for the ABAQUS file format - both surface mesh and fields.
abaqusWriter()
Default construct.
virtual fileName write()
Write surface geometry to file.
A class for handling words, derived from Foam::string.
#define defineTypeName(Type)
Define the typeName.
OBJstream os(runTime.globalPath()/outputName)
bool found(const ListType &input, const UnaryPredicate &pred, const label start=0)
Same as found_if.
Namespace for surface writers.
Pair< label > labelPair
A pair of labels.
List< label > labelList
A List of labels.
bool mkDir(const fileName &pathName, mode_t mode=0777)
Make a directory and return an error if it could not be created.
messageStream Info
Information stream (stdout output on master, null elsewhere).
List< face > faceList
List of faces.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void writeConnectivity(Ostream &os, const label elemId, const labelUList &elem)
vectorField pointField
pointField is a vectorField.
UList< label > labelUList
A UList of labels.
bool isDir(const fileName &name, const bool followLink=true)
Does the name exist as a DIRECTORY in the file system?
constexpr char nl
The newline '\n' character (0x0a).
#define forAll(list, i)
Loop across all elements in list.
Convenience macros for instantiating surfaceWriter methods.
#define defineSurfaceWriterWriteFields(ThisClass)