/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2018-2024 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "nastranCoordSetWriter.H" #include "coordSet.H" #include "IOmanip.H" #include "OFstream.H" #include "OSspecific.H" #include "coordSetWriterMethods.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam { namespace coordSetWriters { defineTypeName(nastranWriter); addToRunTimeSelectionTable(coordSetWriter, nastranWriter, word); addToRunTimeSelectionTable(coordSetWriter, nastranWriter, wordDict); } } // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * // namespace Foam { template static inline void putValue(Ostream& os, const Type& value, const int width) { if (width) os << setw(width); os << value; } } // End namespace Foam // * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // Foam::Ostream& Foam::coordSetWriters::nastranWriter::writeKeyword ( Ostream& os, const word& keyword ) const { return fileFormats::NASCore::writeKeyword(os, keyword, writeFormat_); } // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // Foam::coordSetWriters::nastranWriter::nastranWriter() : coordSetWriter(), writeFormat_(fieldFormat::FREE), separator_() { if (writeFormat_ == fieldFormat::FREE) { separator_ = ","; } } Foam::coordSetWriters::nastranWriter::nastranWriter(const dictionary& options) : coordSetWriter(options), writeFormat_ ( fileFormats::NASCore::fieldFormatNames.getOrDefault ( "format", options, fieldFormat::FREE ) ), separator_() { if (writeFormat_ == fieldFormat::FREE) { separator_ = ","; } } Foam::coordSetWriters::nastranWriter::nastranWriter ( const coordSet& coords, const fileName& outputPath, const dictionary& options ) : nastranWriter(options) { open(coords, outputPath); } Foam::coordSetWriters::nastranWriter::nastranWriter ( const UPtrList& tracks, const fileName& outputPath, const dictionary& options ) : nastranWriter(options) { open(tracks, outputPath); } // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::coordSetWriters::nastranWriter::~nastranWriter() { close(); } // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::fileName Foam::coordSetWriters::nastranWriter::path() const { // 1) rootdir/