/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2026 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 "fixedJumpFvPatchField.H"
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
template
Foam::Field& Foam::fixedJumpFvPatchField::jumpRef()
{
if (!this->cyclicPatch().owner())
{
FatalErrorInFunction
<< "The jump field is not available on the neighbour patch"
<< exit(FatalError);
}
return jump_;
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
template
Foam::fixedJumpFvPatchField::fixedJumpFvPatchField
(
const fvPatch& p,
const DimensionedField& iF,
const dictionary& dict,
const bool jumpRequired
)
:
jumpCyclicFvPatchField(p, iF, dict),
jump_(p.size())
{
if (jumpRequired)
{
if (this->cyclicPatch().owner())
{
jump_ = Field("jump", iF.dimensions(), dict, p.size());
}
this->evaluateNoUpdateCoeffs();
}
}
template
Foam::fixedJumpFvPatchField::fixedJumpFvPatchField
(
const fixedJumpFvPatchField& ptf,
const fvPatch& p,
const DimensionedField& iF,
const fieldMapper& mapper
)
:
jumpCyclicFvPatchField(ptf, p, iF, mapper),
jump_(mapper(ptf.jump_))
{}
template
Foam::fixedJumpFvPatchField::fixedJumpFvPatchField
(
const fixedJumpFvPatchField& ptf,
const DimensionedField& iF
)
:
jumpCyclicFvPatchField(ptf, iF),
jump_(ptf.jump_)
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template
Foam::tmp> Foam::fixedJumpFvPatchField::jump() const
{
if (this->cyclicPatch().owner())
{
return -jump_;
}
else
{
const fixedJumpFvPatchField& nbrField =
refCast>(this->nbrPatchField());
return nbrField.jump_;
}
}
template
void Foam::fixedJumpFvPatchField::map
(
const fvPatchField& ptf,
const fieldMapper& mapper
)
{
jumpCyclicFvPatchField::map(ptf, mapper);
const fixedJumpFvPatchField& tiptf =
refCast>(ptf);
mapper(jump_, tiptf.jump_);
}
template
void Foam::fixedJumpFvPatchField::reset
(
const fvPatchField& ptf
)
{
jumpCyclicFvPatchField::reset(ptf);
const fixedJumpFvPatchField& tiptf =
refCast>(ptf);
jump_.reset(tiptf.jump_);
}
template
void Foam::fixedJumpFvPatchField::write(Ostream& os) const
{
fvPatchField::write(os);
if (this->cyclicPatch().owner())
{
writeEntry(os, "jump", jump_);
}
}
// ************************************************************************* //