ABAQUSsurfaceFormat.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) 2020 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::fileFormats::ABAQUSsurfaceFormat
28 
29 Description
30  Abaqus surface reader.
31 
32  Output stream options:
33  - ASCII only
34  - compression on/off
35 
36  Output dictionary options: ignored
37 
38 SourceFiles
39  ABAQUSsurfaceFormat.C
40 
41 \*---------------------------------------------------------------------------*/
42 
43 #ifndef ABAQUSsurfaceFormat_H
44 #define ABAQUSsurfaceFormat_H
45 
46 #include "MeshedSurface.H"
47 #include "MeshedSurfaceProxy.H"
48 #include "UnsortedMeshedSurface.H"
50 
51 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
52 
53 namespace Foam
54 {
55 namespace fileFormats
56 {
57 
58 /*---------------------------------------------------------------------------*\
59  Class fileFormats::ABAQUSsurfaceFormat Declaration
60 \*---------------------------------------------------------------------------*/
61 
62 template<class Face>
64 :
65  public MeshedSurface<Face>,
67 {
68  // Private Member Functions
69 
70  //- Output S3 or S4
71  inline static label writeShell
72  (
73  Ostream& os,
74  const Face& f,
75  label elemId,
76  const std::string& elsetName,
77  bool header = true
78  );
79 
80 
81 public:
82 
83  // Constructors
84 
85  //- Default construct
86  ABAQUSsurfaceFormat() = default;
87 
88  //- Read construct from file name
89  explicit ABAQUSsurfaceFormat(const fileName& filename);
90 
91 
92  //- Destructor
93  virtual ~ABAQUSsurfaceFormat() = default;
94 
95 
96  // Static Member Functions
97 
98  //- Write surface mesh components by proxy
99  static void write
100  (
101  const fileName& filename,
102  const MeshedSurfaceProxy<Face>& surf,
103  IOstreamOption streamOpt = IOstreamOption(),
104  const dictionary& /*unused*/ = dictionary::null
105  );
106 
107 
108  // Member Functions
109 
110  //- Read from file
111  virtual bool read
112  (
113  const fileName& filename
114  );
115 
116  //- Write surface mesh to file
117  virtual void write
118  (
119  const fileName& name,
120  IOstreamOption streamOpt = IOstreamOption(),
121  const dictionary& options = dictionary::null
122  ) const
123  {
124  write(name, MeshedSurfaceProxy<Face>(*this), streamOpt, options);
125  }
126 };
127 
128 
129 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
130 
131 } // End namespace fileFormats
132 } // End namespace Foam
133 
134 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
135 
136 #ifdef NoRepository
137  #include "ABAQUSsurfaceFormat.C"
138 #endif
139 
140 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
141 
142 #endif
143 
144 // ************************************************************************* //
ABAQUSsurfaceFormat.C
MeshedSurfaceProxy.H
Foam::fileFormats::ABAQUSsurfaceFormat::read
virtual bool read(const fileName &filename)
Read from file.
Definition: ABAQUSsurfaceFormat.C:127
Foam::fileFormats::ABAQUSsurfaceFormat::write
static void write(const fileName &filename, const MeshedSurfaceProxy< Face > &surf, IOstreamOption streamOpt=IOstreamOption(), const dictionary &=dictionary::null)
Write surface mesh components by proxy.
Definition: ABAQUSsurfaceFormat.C:245
Foam::fileName
A class for handling file names.
Definition: fileName.H:73
Foam::MeshedSurfaceProxy
A proxy for writing MeshedSurface, UnsortedMeshedSurface and surfMesh to various file formats.
Definition: MeshedSurface.H:82
Foam::dictionary::null
static const dictionary null
An empty dictionary, which is also the parent for all dictionaries.
Definition: dictionary.H:392
UnsortedMeshedSurface.H
ABAQUSsurfaceFormatCore.H
Foam::fileFormats::ABAQUSsurfaceFormat::~ABAQUSsurfaceFormat
virtual ~ABAQUSsurfaceFormat()=default
Destructor.
Foam::IOstreamOption
The IOstreamOption is a simple container for options an IOstream can normally have.
Definition: IOstreamOption.H:63
Foam::dictionary
A list of keyword definitions, which are a keyword followed by a number of values (eg,...
Definition: dictionary.H:123
os
OBJstream os(runTime.globalPath()/outputName)
Foam::fileFormats::ABAQUSsurfaceFormatCore
Internal class used by the ABAQUSsurfaceFormat.
Definition: ABAQUSsurfaceFormatCore.H:56
Foam
Namespace for OpenFOAM.
Definition: atmBoundaryLayer.C:33
Foam::fileFormats::ABAQUSsurfaceFormat::ABAQUSsurfaceFormat
ABAQUSsurfaceFormat()=default
Default construct.
f
labelList f(nPoints)
Foam::name
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:56
Foam::fileFormats::ABAQUSsurfaceFormat
Abaqus surface reader.
Definition: ABAQUSsurfaceFormat.H:62
Foam::MeshedSurface
A surface geometry mesh with zone information, not to be confused with the similarly named surfaceMes...
Definition: triSurfaceTools.H:80
MeshedSurface.H