Debian Codegraph @

src/atlas/util/PackVectorFields.h

raw
1 /*
2 * (C) Crown Copyright 2024 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/field.h"
11
12 namespace eckit {
13 class LocalConfiguration;
14 }
15
16 namespace atlas {
17 namespace util {
18
19 /// @brief Packs vector field components into vector fields
20 ///
21 /// @details Iterates through @param fields and creates vector fields from any
22 /// component field with the "vector name" string metadata. These, as
23 /// well as any present scalar fields, are added to the return-value
24 /// field set.
25 /// Note, a mutable @param packedFields field set can be supplied if
26 /// one needs to guarantee the order of the packed fields
27 FieldSet pack_vector_fields(const FieldSet& fields,
28 FieldSet packedFields = FieldSet{});
29
30 /// @brief Unpacks vector field into vector field components.
31 ///
32 /// @details Undoes "pack" operation when a set of packed fields are supplied
33 /// as @param fields. A mutable @param unpackedFields field set can be
34 /// supplied if one needs to guarantee the order of the unpacked
35 /// fields.
36 FieldSet unpack_vector_fields(const FieldSet& fields,
37 FieldSet unpackedFields = FieldSet{});
38
39 } // namespace util
40 } // namespace atlas