meshToMesh, mapFieldsPar: Rationalisation
Cell-to-cell interpolation has been moved to a hierarchy separate from meshToMesh, called cellsToCells. The meshToMesh class is now a combination of a cellsToCells object and multiple patchToPatch objects. This means that when only cell-to-cell interpolation is needed a basic cellsToCells object can be selected. Cell-to-cell and vol-field-to-vol-field interpolation now has two well defined sets of functions, with a clear distinction in how weights that do not sum to unity are handled. Non-unity weights are either normalised, or a left-over field is provided with which to complete the weighted sum. The left-over approach is now consistently applied in mapFieldsPar, across both the internal and patch fields, if mapping onto an existing field in the target case. Warning are now generated for invalid combinations of settings, such as mapping between inconsistent meshes without a pre-existing target field. All mapping functions now take fields as const references and return tmp fields. This avoids the pattern in which non-const fields are provided which relate to the source, and at some point in the function transfer to the target. This pattern is difficult to reason about and does not provide any actual computational advantage, as the fields invariably get re-allocated as part of the process anyway. MeshToMesh no longer stores the cutting patches. The set of cutting patches is not needed anywhere except at the point of mapping a field, so it is now supplied to the mapping functions as an argument. The meshToMesh topology changer no longer supports cutting patch information. This did not previously work. Cutting patches either get generated as calculated, or they require a pre-existing field to specify their boundary condition. Neither of these options is suitable for a run-time mesh change. More code has been shared with patchToPatch, reducing duplication.
This commit is contained in:
@ -21,7 +21,7 @@ airToporous
|
||||
nbrRegion porous;
|
||||
master false;
|
||||
|
||||
interpolationMethod cellVolumeWeight;
|
||||
interpolationMethod intersection;
|
||||
|
||||
semiImplicit no;
|
||||
}
|
||||
@ -34,7 +34,7 @@ porosityBlockage
|
||||
{
|
||||
nbrRegion porous;
|
||||
|
||||
interpolationMethod cellVolumeWeight;
|
||||
interpolationMethod intersection;
|
||||
|
||||
type DarcyForchheimer;
|
||||
|
||||
|
||||
@ -21,7 +21,7 @@ porousToair
|
||||
nbrRegion air;
|
||||
master true;
|
||||
|
||||
interpolationMethod cellVolumeWeight;
|
||||
interpolationMethod intersection;
|
||||
|
||||
semiImplicit no;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user