MeDiPack  1.3.0
A Message Differentiation Package
SciComp TU Kaiserslautern
Loading...
Searching...
No Matches
adjointInterface.hpp
Go to the documentation of this file.
1/*
2 * MeDiPack, a Message Differentiation Package
3 *
4 * Copyright (C) 2015-2024 Chair for Scientific Computing (SciComp), University of Kaiserslautern-Landau
5 * Homepage: http://scicomp.rptu.de
6 * Contact: Prof. Nicolas R. Gauger (codi@scicomp.uni-kl.de)
7 *
8 * Lead developers: Max Sagebaum (SciComp, University of Kaiserslautern-Landau)
9 *
10 * This file is part of MeDiPack (http://scicomp.rptu.de/software/codi).
11 *
12 * MeDiPack is free software: you can redistribute it and/or
13 * modify it under the terms of the GNU Lesser General Public
14 * License as published by the Free Software Foundation, either
15 * version 3 of the License, or (at your option) any later version.
16 *
17 * MeDiPack is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
20 *
21 * See the GNU Lesser General Public License for more details.
22 * You should have received a copy of the GNU
23 * Lesser General Public License along with MeDiPack.
24 * If not, see <http://www.gnu.org/licenses/>.
25 *
26 * Authors: Max Sagebaum, Tim Albring (SciComp, University of Kaiserslautern-Landau)
27 */
28
29#pragma once
30
31#include "typeDefinitions.h"
32#include "adToolInterface.h"
33
37namespace medi {
38
39
41 public:
42
48 virtual int computeElements(int elements) const = 0;
49
54 virtual int getVectorSize() const = 0;
55
62 virtual void createPrimalTypeBuffer(void* &buf, size_t size) const = 0;
63
69 virtual void deletePrimalTypeBuffer(void* &buf) const = 0;
70
77 virtual void createAdjointTypeBuffer(void* &buf, size_t size) const = 0;
78
84 virtual void deleteAdjointTypeBuffer(void* &buf) const = 0;
85
92 virtual void combineAdjoints(void* buf, const int elements, const int ranks) const = 0;
93
101 virtual void getAdjoints(const void* indices, void* adjoints, int elements) const = 0;
102
113 virtual void updateAdjoints(const void* indices, const void* adjoints, int elements) const = 0;
114
124 virtual void getPrimals(const void* indices, const void* primals, int elements) const = 0;
125
135 virtual void setPrimals(const void* indices, const void* primals, int elements) const = 0;
136 };
137}
Definition adjointInterface.hpp:40
virtual void updateAdjoints(const void *indices, const void *adjoints, int elements) const =0
Add the adjoint varaibles to the ones in the AD tool. That is the AD tool should perform the operatio...
virtual void createPrimalTypeBuffer(void *&buf, size_t size) const =0
Create an array for the primal variables.
virtual void deletePrimalTypeBuffer(void *&buf) const =0
Delete the array of the primal variables.
virtual void getPrimals(const void *indices, const void *primals, int elements) const =0
Get the primal values from the AD tool.
virtual void getAdjoints(const void *indices, void *adjoints, int elements) const =0
Get the adjoints for the indices from the AD tool.
virtual void createAdjointTypeBuffer(void *&buf, size_t size) const =0
Create an array for the adjoint variables.
virtual int getVectorSize() const =0
The vector size for the current evaluation.
virtual void combineAdjoints(void *buf, const int elements, const int ranks) const =0
Perform a reduction in the first element of the buffer.
virtual int computeElements(int elements) const =0
Compute the number of active types in the buffer.
virtual void deleteAdjointTypeBuffer(void *&buf) const =0
Delete the array of the adjoint variables.
virtual void setPrimals(const void *indices, const void *primals, int elements) const =0
Set the primal values on the AD tool.
Global namespace for MeDiPack - Message Differentiation Package.
Definition adjointInterface.hpp:37