patchInjection: Check for 0-patches
This commit is contained in:
parent
df85b892a5
commit
fb3eddd2cb
1 changed files with 13 additions and 1 deletions
|
|
@ -82,6 +82,13 @@ patchInjection::patchInjection
|
||||||
|
|
||||||
patchInjectedMasses_.setSize(pbm.size(), 0);
|
patchInjectedMasses_.setSize(pbm.size(), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!patchIDs_.size())
|
||||||
|
{
|
||||||
|
FatalErrorIn("patchInjection::patchInjection")
|
||||||
|
<< "No patches selected"
|
||||||
|
<< exit(FatalError);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -100,6 +107,9 @@ void patchInjection::correct
|
||||||
scalarField& diameterToInject
|
scalarField& diameterToInject
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
// Do not correct if no patches selected
|
||||||
|
if (!patchIDs_.size()) return;
|
||||||
|
|
||||||
const scalarField& delta = owner().delta();
|
const scalarField& delta = owner().delta();
|
||||||
const scalarField& rho = owner().rho();
|
const scalarField& rho = owner().rho();
|
||||||
const scalarField& magSf = owner().magSf();
|
const scalarField& magSf = owner().magSf();
|
||||||
|
|
@ -160,6 +170,9 @@ void patchInjection::correct
|
||||||
|
|
||||||
void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
||||||
{
|
{
|
||||||
|
// Do not correct if no patches selected
|
||||||
|
if (!patchIDs_.size()) return;
|
||||||
|
|
||||||
scalarField patchInjectedMasses
|
scalarField patchInjectedMasses
|
||||||
(
|
(
|
||||||
getModelProperty<scalarField>
|
getModelProperty<scalarField>
|
||||||
|
|
@ -170,7 +183,6 @@ void patchInjection::patchInjectedMassTotals(scalarField& patchMasses) const
|
||||||
);
|
);
|
||||||
|
|
||||||
scalarField patchInjectedMassTotals(patchInjectedMasses_);
|
scalarField patchInjectedMassTotals(patchInjectedMasses_);
|
||||||
//combineReduce(patchInjectedMassTotals, plusEqOp<scalarField>());
|
|
||||||
Pstream::listCombineGather(patchInjectedMassTotals, plusEqOp<scalar>());
|
Pstream::listCombineGather(patchInjectedMassTotals, plusEqOp<scalar>());
|
||||||
|
|
||||||
forAll(patchIDs_, pidi)
|
forAll(patchIDs_, pidi)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue