Smith  0.1
Smith is an implicit thermal structural mechanics simulation code.
differentiate_wrt.hpp
1 // Copyright (c) Lawrence Livermore National Security, LLC and
2 // other Smith Project Developers. See the top-level LICENSE file for
3 // details.
4 //
5 // SPDX-License-Identifier: (BSD-3-Clause)
6 #pragma once
7 
8 #include "mfem.hpp"
9 
10 namespace smith {
11 
12 static constexpr uint32_t NO_DIFFERENTIATION = uint32_t(1) << 31;
13 
14 template <uint32_t i>
15 struct DifferentiateWRT {};
16 
22  const mfem::Vector& ref;
23 
25  operator const mfem::Vector&() const { return ref; }
26 };
27 
41 inline auto differentiate_wrt(const mfem::Vector& v) { return differentiate_wrt_this{v}; }
42 
43 } // namespace smith
Accelerator functionality.
Definition: smith.cpp:36
auto differentiate_wrt(const mfem::Vector &v)
this function is intended to only be used in combination with smith::Functional::operator(),...
this type exists solely as a way to signal to smith::Functional that the function smith::Functional::...
const mfem::Vector & ref
the actual data wrapped by this type