vectorTensorTransform.C
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) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
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\*---------------------------------------------------------------------------*/
27
29#include "IOstreams.H"
30#include "StringStream.H"
31
32// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33
35 "vectorTensorTransform";
36
38(
39 Zero,
40 Zero,
41 false
42);
43
44
46(
47 Zero,
48 sphericalTensor::I,
49 false
50);
51
52
53// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
54
56{
57 is >> *this;
58}
59
60
61// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
62
64{
65 OStringStream buf;
66
67 buf << '(' << s.t() << ',' << s.R() << ')';
68
69 return buf.str();
70}
71
72
73template<>
75(
76 const Field<bool>& fld
77) const
78{
79 return fld;
80}
81template<>
83(
84 const Field<label>& fld
85) const
86{
87 return fld;
88}
89template<>
91(
92 const Field<scalar>& fld
93) const
94{
95 return fld;
96}
97
98
99// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
100
102{
103 is.readBegin("vectorTensorTransform");
104
105 is >> tr.t_ >> tr.R_ >> tr.hasR_;
106
107 is.readEnd("vectorTensorTransform");
108
110
111 return is;
112}
113
114
116{
118 << tr.t() << token::SPACE << tr.R() << token::SPACE << tr.hasR()
120
121 return os;
122}
123
124
125// ************************************************************************* //
Useful combination of include files which define Sin, Sout and Serr and the use of IO streams general...
Input/output from string buffers.
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
Foam::string str() const
Get the string - as Foam::string rather than std::string.
Definition: StringStream.H:88
Generic templated field type.
Definition: Field.H:82
virtual bool check(const char *operation) const
Check IOstream status for given operation.
Definition: IOstream.C:58
An Istream is an abstract base class for all input systems (streams, files, token lists etc)....
Definition: Istream.H:64
bool readEnd(const char *funcName)
End read of data chunk, ends with ')'.
Definition: Istream.C:129
bool readBegin(const char *funcName)
Begin read of data chunk, starts with '('.
Definition: Istream.C:111
Output to string buffer, using a OSstream. Always UNCOMPRESSED.
Definition: StringStream.H:231
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:62
Default transformation behaviour.
A class for managing temporary objects.
Definition: tmp.H:65
@ BEGIN_LIST
Begin list [isseparator].
Definition: token.H:155
@ END_LIST
End list [isseparator].
Definition: token.H:156
@ SPACE
Space [isspace].
Definition: token.H:125
Vector-tensor class used to perform translations and rotations in 3D space.
static const vectorTensorTransform I
static const vectorTensorTransform zero
vectorTensorTransform()
Default construct - no translation, identity rotation.
static const char *const typeName
A class for handling words, derived from Foam::string.
Definition: word.H:68
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
#define FUNCTION_NAME
dimensionedScalar tr(const dimensionedSphericalTensor &dt)
Ostream & operator<<(Ostream &, const boundaryPatch &p)
Write boundaryPatch as dictionary entries (without surrounding braces)
Definition: boundaryPatch.C:83
Istream & operator>>(Istream &, directionInfo &)
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
Definition: exprTraits.C:59