nastranSetWriter.H
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) 2018-2021 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 Class
27  Foam::nastranSetWriter
28 
29 Description
30  Line format in Nastran (currently hardcoded to 'free' format)
31 
32  Does not do field data.
33 
34 SourceFiles
35  nastranSetWriter.C
36 
37 \*---------------------------------------------------------------------------*/
38 
39 #ifndef nastranSetWriter_H
40 #define nastranSetWriter_H
41 
42 #include "writer.H"
43 #include "NASCore.H"
44 
45 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
46 
47 namespace Foam
48 {
49 
50 /*---------------------------------------------------------------------------*\
51  Class nastranSetWriter Declaration
52 \*---------------------------------------------------------------------------*/
53 
54 template<class Type>
55 class nastranSetWriter
56 :
57  public writer<Type>
58 {
59  // Private Member Functions
60 
61  //- Write the formatted keyword to the output stream
62  Ostream& writeKeyword
63  (
64  Ostream& os,
65  const word& keyword
66  ) const;
67 
68 
69 public:
70 
71  //- File field formats
73 
74 
75  //- Runtime type information
76  TypeName("nastran");
77 
78 
79  // Constructors
80 
81  //- Default construct
83 
84  //- Construct with dictionary
85  explicit nastranSetWriter(const dictionary& dict);
86 
87 
88  //- Destructor
89  virtual ~nastranSetWriter() = default;
90 
91 
92  // Member Functions
93 
94  virtual fileName getFileName
95  (
96  const coordSet&,
97  const wordList&
98  ) const;
99 
100  virtual void write
101  (
102  const coordSet&,
103  const wordList&,
104  const List<const Field<Type>*>&,
105  Ostream&
106  ) const;
107 
108  virtual void write
109  (
110  const bool writeTracks,
111  const List<scalarField>& times,
112  const PtrList<coordSet>& tracks,
113  const wordList& valueSetNames,
114  const List<List<Field<Type>>>& valueSets,
115  Ostream&
116  ) const;
117 };
118 
119 
120 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
121 
122 } // End namespace Foam
123 
124 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
125 
126 #ifdef NoRepository
127  #include "nastranSetWriter.C"
128 #endif
129 
130 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
131 
132 #endif
133 
134 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:65
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
nastranSetWriter.C
Foam::nastranSetWriter
Line format in Nastran (currently hardcoded to 'free' format)
Definition: nastranSetWriter.H:54
Foam::nastranSetWriter::write
virtual void write(const coordSet &, const wordList &, const List< const Field< Type > * > &, Ostream &) const
General entry point for writing.
Definition: nastranSetWriter.C:64
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::nastranSetWriter::~nastranSetWriter
virtual ~nastranSetWriter()=default
Destructor.
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:59
dict
dictionary dict
Definition: searchingEngine.H:14
NASCore.H
Foam::nastranSetWriter::getFileName
virtual fileName getFileName(const coordSet &, const wordList &) const
Generate file name with correct extension.
Definition: nastranSetWriter.C:53
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
Foam::nastranSetWriter::nastranSetWriter
nastranSetWriter()
Default construct.
Definition: nastranSetWriter.C:36
os
OBJstream os(runTime.globalPath()/outputName)
Foam::writer
Base class for graphics format writing. Entry points are.
Definition: writer.H:81
Foam::coordSet
Holds list of sampling positions.
Definition: coordSet.H:53
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::nastranSetWriter::TypeName
TypeName("nastran")
Runtime type information.
Foam::List< word >
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
writer.H
Foam::fileFormats::NASCore::fieldFormat
fieldFormat
File field formats.
Definition: NASCore.H:63