ENH: Jump conditions - only store jump on owner-side

This commit is contained in:
andy
2012-11-19 16:19:05 +00:00
parent 69e76367a1
commit 98a0ae49b0
2 changed files with 24 additions and 4 deletions

View File

@ -62,8 +62,13 @@ Foam::fixedJumpFvPatchField<Type>::fixedJumpFvPatchField
)
:
jumpCyclicFvPatchField<Type>(p, iF),
jump_("jump", dict, p.size())
jump_(p.size(), pTraits<Type>::zero)
{
if (this->cyclicPatch().owner())
{
jump_ = Field<Type>("jump", dict, p.size());
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=
@ -152,7 +157,12 @@ void Foam::fixedJumpFvPatchField<Type>::write(Ostream& os) const
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << this->interfaceFieldType()
<< token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
if (this->cyclicPatch().owner())
{
jump_.writeEntry("jump", os);
}
this->writeEntry("value", os);
}

View File

@ -62,8 +62,13 @@ Foam::fixedJumpAMIFvPatchField<Type>::fixedJumpAMIFvPatchField
)
:
jumpCyclicAMIFvPatchField<Type>(p, iF),
jump_("jump", dict, p.size())
jump_(p.size(), pTraits<Type>::zero)
{
if (this->cyclicAMIPatch().owner())
{
jump_ = Field<Type>("jump", dict, p.size());
}
if (dict.found("value"))
{
fvPatchField<Type>::operator=
@ -155,7 +160,12 @@ void Foam::fixedJumpAMIFvPatchField<Type>::write(Ostream& os) const
fvPatchField<Type>::write(os);
os.writeKeyword("patchType") << this->interfaceFieldType()
<< token::END_STATEMENT << nl;
jump_.writeEntry("jump", os);
if (this->cyclicAMIPatch().owner())
{
jump_.writeEntry("jump", os);
}
this->writeEntry("value", os);
}