ENH: setFields: check for writing of fields

This commit is contained in:
mattijs
2012-06-18 14:31:45 +01:00
parent ef2ce78768
commit 1c44fc6aec

View File

@ -92,7 +92,15 @@ bool setCellFieldType
field.boundaryField()[patchi].patchInternalField(); field.boundaryField()[patchi].patchInternalField();
} }
field.write(); if (!field.write())
{
FatalErrorIn
(
"void setCellFieldType"
"(const fvMesh& mesh, const labelList& selectedCells,"
"Istream& fieldValueStream)"
) << "Failed writing field " << fieldName << endl;
}
} }
else else
{ {
@ -260,7 +268,15 @@ bool setFaceFieldType
} }
} }
field.write(); if (!field.write())
{
FatalErrorIn
(
"void setFaceFieldType"
"(const fvMesh& mesh, const labelList& selectedFaces,"
"Istream& fieldValueStream)"
) << "Failed writing field " << field.name() << exit(FatalError);
}
} }
else else
{ {