atlas
Redistribution.h
1 /*
2  * (C) Crown Copyright 2021 Met Office
3  *
4  * This software is licensed under the terms of the Apache Licence Version 2.0
5  * which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
6  */
7 
8 #pragma once
9 
10 #include "atlas/redistribution/detail/RedistributionImpl.h"
11 #include "atlas/util/ObjectHandle.h"
12 
13 namespace atlas {
14 class Field;
15 class FieldSet;
16 class FunctionSpace;
17 } // namespace atlas
18 
19 namespace atlas {
20 
25 class Redistribution : public util::ObjectHandle<redistribution::detail::RedistributionImpl> {
26 public:
27  using Handle::Handle;
28 
31 
40  Redistribution( const FunctionSpace& sourceFunctionSpace, const FunctionSpace& targetFunctionSpace );
41 
50  void execute( const Field& sourceField, Field& targetField ) const;
51 
59  void execute( const FieldSet& sourceFieldSet, FieldSet& targetFieldSet ) const;
60 
63 
65  const FunctionSpace& source() const;
66 
69 
71  const FunctionSpace& target() const;
72 };
73 
74 } // namespace atlas
A Field contains an Array, Metadata, and a reference to a FunctionSpace.
Definition: Field.h:59
Base redistributer class.
Definition: Redistribution.h:25
FunctionSpace & target()
Get reference to taget function space.
Definition: Redistribution.cc:39
void execute(const Field &sourceField, Field &targetField) const
Maps source field to target field.
Definition: Redistribution.cc:21
Represents a set of fields, where order is preserved.
Definition: FieldSet.h:146
FunctionSpace & source()
Get reference to source function space.
Definition: Redistribution.cc:31
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
Redistribution()
Empty default constructor.
Definition: Redistribution.cc:17
Definition: ObjectHandle.h:64
Definition: FunctionSpace.h:39