atlas
RedistributionImpl.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/functionspace.h"
11 #include "atlas/util/Object.h"
12 
13 namespace atlas {
14 class Field;
15 class FieldSet;
16 class FunctionSpace;
17 } // namespace atlas
18 
19 namespace atlas {
20 namespace redistribution {
21 namespace detail {
22 
25 public:
27  virtual ~RedistributionImpl() = default;
28 
30  virtual void execute( const Field& sourceField, Field& targetField ) const = 0;
31 
33  virtual void execute( const FieldSet& sourceFieldSet, FieldSet& targetFieldSet ) const = 0;
34 
37 
39  const FunctionSpace& source() const;
40 
43 
45  const FunctionSpace& target() const;
46 
47 protected:
48  RedistributionImpl( const FunctionSpace& source, const FunctionSpace& target );
49 
50 private:
51  FunctionSpace sourceFunctionSpace_;
52  FunctionSpace targetFunctionSpace_;
53 };
54 
55 } // namespace detail
56 } // namespace redistribution
57 } // namespace atlas
A Field contains an Array, Metadata, and a reference to a FunctionSpace.
Definition: Field.h:59
virtual void execute(const Field &sourceField, Field &targetField) const =0
Maps source field to target field.
virtual ~RedistributionImpl()=default
Virtual destructor.
FunctionSpace & source()
Get reference to source function space.
Definition: RedistributionImpl.cc:21
Definition: Object.h:18
Abstract base class for redistributor implementation.
Definition: RedistributionImpl.h:24
Represents a set of fields, where order is preserved.
Definition: FieldSet.h:146
Contains all atlas classes and methods.
Definition: atlas-grids.cc:33
FunctionSpace & target()
Get reference to target function space.
Definition: RedistributionImpl.cc:29
Definition: FunctionSpace.h:39