/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
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 "valuePointPatchField.H"
#include "pointPatchFieldMapper.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
template
void Foam::valuePointPatchField::checkFieldSize() const
{
if (this->size() != this->patch().size())
{
FatalErrorInFunction
<< "field does not correspond to patch. " << endl
<< "Field size: " << size() << " patch size: "
<< this->patch().size()
<< abort(FatalError);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * * //
template
Foam::valuePointPatchField::valuePointPatchField
(
const pointPatch& p,
const DimensionedField& iF
)
:
pointPatchField(p, iF),
Field(p.size())
{}
template
Foam::valuePointPatchField::valuePointPatchField
(
const pointPatch& p,
const DimensionedField& iF,
const dictionary& dict,
const bool valueRequired
)
:
pointPatchField(p, iF, dict),
Field(p.size())
{
if (dict.found("value"))
{
Field::operator=
(
Field("value", dict, p.size())
);
}
else if (!valueRequired)
{
Field::operator=(pTraits::zero);
}
else
{
FatalIOErrorInFunction
(
dict
) << "Essential entry 'value' missing"
<< exit(FatalIOError);
}
}
template
Foam::valuePointPatchField::valuePointPatchField
(
const valuePointPatchField& ptf,
const pointPatch& p,
const DimensionedField& iF,
const pointPatchFieldMapper& mapper
)
:
pointPatchField(ptf, p, iF, mapper),
Field(ptf, mapper)
{}
template
Foam::valuePointPatchField::valuePointPatchField
(
const valuePointPatchField& ptf,
const DimensionedField& iF
)
:
pointPatchField(ptf, iF),
Field(ptf)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
void Foam::valuePointPatchField::autoMap
(
const pointPatchFieldMapper& m
)
{
Field::autoMap(m);
}
template
void Foam::valuePointPatchField::rmap
(
const pointPatchField& ptf,
const labelList& addr
)
{
Field::rmap
(
refCast>
(
ptf
),
addr
);
}
template
void Foam::valuePointPatchField::updateCoeffs()
{
if (this->updated())
{
return;
}
// Get internal field to insert values into
Field& iF = const_cast&>(this->internalField());
this->setInInternalField(iF, *this);
pointPatchField::updateCoeffs();
}
template
void Foam::valuePointPatchField::evaluate(const Pstream::commsTypes)
{
// Get internal field to insert values into
Field& iF = const_cast&>(this->internalField());
this->setInInternalField(iF, *this);
pointPatchField::evaluate();
}
template
void Foam::valuePointPatchField::write(Ostream& os) const
{
pointPatchField::write(os);
this->writeEntry("value", os);
}
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
template
void Foam::valuePointPatchField::operator=
(
const valuePointPatchField& ptf
)
{
Field::operator=(ptf);
}
template
void Foam::valuePointPatchField::operator=
(
const pointPatchField& ptf
)
{
Field::operator=(ptf.patchInternalField());
}
template
void Foam::valuePointPatchField::operator=
(
const Field& tf
)
{
Field::operator=(tf);
}
template
void Foam::valuePointPatchField::operator=
(
const Type& t
)
{
Field::operator=(t);
}
// Force an assignment
template
void Foam::valuePointPatchField::operator==
(
const valuePointPatchField& ptf
)
{
Field::operator=(ptf);
}
template
void Foam::valuePointPatchField::operator==
(
const pointPatchField& ptf
)
{
Field::operator=(ptf.patchInternalField());
}
template
void Foam::valuePointPatchField::operator==
(
const Field& tf
)
{
Field::operator=(tf);
}
template
void Foam::valuePointPatchField::operator==
(
const Type& t
)
{
Field::operator=(t);
}
// ************************************************************************* //