/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2016 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . \*---------------------------------------------------------------------------*/ #include "steadyParticleTracksTemplates.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template bool Foam::fieldOk(const IOobjectList& cloudObjs, const word& name) { return cloudObjs.cfindObject>(name) != nullptr; } template Foam::tmp> Foam::readParticleField ( const word& name, const IOobjectList cloudObjs ) { const IOobject* obj = cloudObjs.cfindObject>(name); if (obj != nullptr) { IOField newField(*obj); return tmp>::New(std::move(newField)); } FatalErrorInFunction << "Error: cloud field name " << name << " not found or the wrong type" << abort(FatalError); return Field::null(); } template void Foam::readFields ( PtrList>& values, const List& fieldNames, const IOobjectList& cloudObjs ) { forAll(fieldNames, fieldi) { const word& fieldName = fieldNames[fieldi]; const IOobject* obj = cloudObjs.cfindObject>(fieldName); if (obj != nullptr) { Info<< " reading field " << fieldName << endl; IOField newField(*obj); values.set(fieldi, new List(std::move(newField))); } else { FatalErrorInFunction << "Unable to read field " << fieldName << abort(FatalError); } } } template void Foam::writeVTK(OFstream& os, const Type& value) { os << value.component(0); for (label i=1; i::nComponents; i++) { os << ' ' << value.component(i); } } template void Foam::writeVTKFields ( OFstream& os, const PtrList>& values, const List>& addr, const List& fieldNames ) { label step = max(floor(8/pTraits::nComponents), 1); forAll(values, fieldi) { Info<< " writing field " << fieldNames[fieldi] << endl; os << nl << fieldNames[fieldi] << ' ' << int(pTraits::nComponents) << ' ' << values[fieldi].size() << " float" << nl; label offset = 0; forAll(addr, tracki) { const List