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 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 public:
60 
61  //- File field formats
63 
64 private:
65 
66  // Private Member Functions
67 
68  //- Write the formatted keyword to the output stream
69  Ostream& writeKeyword
70  (
71  Ostream& os,
72  const word& keyword
73  ) const;
74 
75 
76 public:
77 
78  //- Runtime type information
79  TypeName("nastran");
80 
81 
82  // Constructors
83 
84  //- Construct null
86 
87 
88  //- Destructor
89  virtual ~nastranSetWriter();
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 PtrList<coordSet>&,
112  const wordList& valueSetNames,
113  const List<List<Field<Type>>>&,
114  Ostream&
115  ) const;
116 };
117 
118 
119 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
120 
121 } // End namespace Foam
122 
123 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
124 
125 #ifdef NoRepository
126  #include "nastranSetWriter.C"
127 #endif
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 #endif
132 
133 // ************************************************************************* //
Foam::word
A class for handling words, derived from Foam::string.
Definition: word.H:62
Foam::fileName
A class for handling file names.
Definition: fileName.H:69
Foam::nastranSetWriter::~nastranSetWriter
virtual ~nastranSetWriter()
Destructor.
Definition: nastranSetWriter.C:44
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:63
Foam::Field
Generic templated field type.
Definition: Field.H:63
Foam::PtrList
A list of pointers to objects of type <T>, with allocation/deallocation management of the pointers....
Definition: List.H:62
NASCore.H
Foam::nastranSetWriter::getFileName
virtual fileName getFileName(const coordSet &, const wordList &) const
Generate file name with correct extension.
Definition: nastranSetWriter.C:52
Foam::nastranSetWriter::nastranSetWriter
nastranSetWriter()
Construct null.
Definition: nastranSetWriter.C:36
Foam::writer
Base class for graphics format writing. Entry points are.
Definition: writer.H:80
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