template<typename WorkField, bool constSize = false>
class walberla::field::FieldClone< WorkField, constSize >
Helper class for the common scenario where a 'scratch field' is needed.
Consider for example a LBM stream operation: Usually two fields are used, one source field to read the values and one destination field where the result is written to. In the end both fields are swapped. Now if one has multiple fields per block one scratch field is enough if all fields have the same size.
This class helps in this scenario by providing that extra scratch field. The first time get() is called, a clone of the field is created and returned. Further calls return the same scratch field.
If fields have different sizes one scratch field is held for each size.
- Template Parameters
-
WorkField | field that has to be derived from GhostLayerField |
constSize | have all fields the same size? |