Serac  0.1
Serac is an implicit thermal strucural mechanics simulation code.
differentiate_wrt.hpp
1 // Copyright (c) 2019-2024, Lawrence Livermore National Security, LLC and
2 // other Serac 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 serac {
11 
12 static constexpr uint32_t NO_DIFFERENTIATION = uint32_t(1) << 31;
13 
14 template <uint32_t i>
16 };
17 
23  const mfem::Vector& ref;
24 
26  operator const mfem::Vector&() const { return ref; }
27 };
28 
42 inline auto differentiate_wrt(const mfem::Vector& v) { return differentiate_wrt_this{v}; }
43 
44 } // namespace serac
Accelerator functionality.
Definition: serac.cpp:38
auto differentiate_wrt(const mfem::Vector &v)
this function is intended to only be used in combination with serac::Functional::operator(),...
this type exists solely as a way to signal to serac::Functional that the function serac::Functional::...
const mfem::Vector & ref
the actual data wrapped by this type