1 /*---------------------------------------------------------------------------*\
3 \\ / F ield | foam-extend: Open Source CFD
4 \\ / O peration | Version: 3.2
5 \\ / A nd | Web: http://www.foam-extend.org
6 \\/ M anipulation | For copyright notice see file Copyright
7 -------------------------------------------------------------------------------
9 This file is part of foam-extend.
11 foam-extend is free software: you can redistribute it and/or modify it
12 under the terms of the GNU General Public License as published by the
13 Free Software Foundation, either version 3 of the License, or (at your
14 option) any later version.
16 foam-extend is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with foam-extend. If not, see <http://www.gnu.org/licenses/>.
24 \*---------------------------------------------------------------------------*/
26 #include "readFields.H"
27 #include "dictionary.H"
29 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
33 defineTypeNameAndDebug(readFields, 0);
37 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
39 Foam::readFields::readFields
42 const objectRegistry& obr,
43 const dictionary& dict,
44 const bool loadFromFiles
52 // Check if the available mesh is an fvMesh otherise deactivate
53 if (!isA<fvMesh>(obr_))
58 "readFields::readFields"
61 "const objectRegistry&, "
65 ) << "No fvMesh available, deactivating."
73 // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
75 Foam::readFields::~readFields()
79 // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
81 void Foam::readFields::read(const dictionary& dict)
85 dict.lookup("fields") >> fieldSet_;
90 void Foam::readFields::execute()
92 //Info<< type() << " " << name_ << ":" << nl;
94 // Clear out any previously loaded fields
107 forAll(fieldSet_, fieldI)
109 // If necessary load field
110 loadField<scalar>(fieldSet_[fieldI], vsf_, ssf_);
111 loadField<vector>(fieldSet_[fieldI], vvf_, svf_);
112 loadField<sphericalTensor>(fieldSet_[fieldI], vSpheretf_, sSpheretf_);
113 loadField<symmTensor>(fieldSet_[fieldI], vSymmtf_, sSymmtf_);
114 loadField<tensor>(fieldSet_[fieldI], vtf_, stf_);
119 void Foam::readFields::end()
125 void Foam::readFields::write()
131 // ************************************************************************* //