Debian Codegraph @

src/atlas/mesh/detail/MeshIntf.cc

raw
1 /*
2 * (C) Copyright 2013 ECMWF.
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 * In applying this licence, ECMWF does not waive the privileges and immunities
7 * granted to it by virtue of its status as an intergovernmental organisation
8 * nor does it submit to any jurisdiction.
9 */
10
11 #include "atlas/mesh/detail/MeshIntf.h"
12 #include "atlas/mesh/Nodes.h"
13 #include "atlas/runtime/Exception.h"
14
15 namespace atlas {
16 namespace mesh {
17
18 //----------------------------------------------------------------------------------------------------------------------
19 // C wrapper interfaces to C++ routines
20
21 Mesh::Implementation* atlas__Mesh__new() {
22 return new Mesh::Implementation();
23 }
24
25 void atlas__Mesh__delete(Mesh::Implementation* This) {
26 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
27 delete This;
28 }
29
30 Nodes* atlas__Mesh__nodes(Mesh::Implementation* This) {
31 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
32 return &This->nodes();
33 }
34
35 Edges* atlas__Mesh__edges(Mesh::Implementation* This) {
36 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
37 return &This->edges();
38 }
39
40 Cells* atlas__Mesh__cells(Mesh::Implementation* This) {
41 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
42 return &This->cells();
43 }
44
45 size_t atlas__Mesh__footprint(Mesh::Implementation* This) {
46 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
47 return This->footprint();
48 }
49
50 void atlas__Mesh__update_device(Mesh::Implementation* This) {
51 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
52 This->updateDevice();
53 }
54
55 void atlas__Mesh__update_host(Mesh::Implementation* This) {
56 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
57 This->updateHost();
58 }
59
60 void atlas__Mesh__sync_host_device(Mesh::Implementation* This) {
61 ATLAS_ASSERT(This != nullptr, "Cannot access uninitialisd atlas_Mesh");
62 This->syncHostDevice();
63 }
64
65 //----------------------------------------------------------------------------------------------------------------------
66
67 } // namespace mesh
68 } // namespace atlas