ImpactX
Loading...
Searching...
No Matches
lineartransport.H
Go to the documentation of this file.
1/* Copyright 2022-2023 The Regents of the University of California, through Lawrence
2 * Berkeley National Laboratory (subject to receipt of any required
3 * approvals from the U.S. Dept. of Energy). All rights reserved.
4 *
5 * This file is part of ImpactX.
6 *
7 * Authors: Axel Huebl
8 * License: BSD-3-Clause-LBNL
9 */
10#ifndef IMPACTX_ELEMENTS_MIXIN_LINEAR_TRANSPORT_H
11#define IMPACTX_ELEMENTS_MIXIN_LINEAR_TRANSPORT_H
12
14
15#include <ablastr/constant.H>
16
17#include <AMReX_Math.H>
18#include <AMReX_Extension.H>
19#include <AMReX_REAL.H>
20#include <AMReX_SmallMatrix.H>
21
22
24{
27 template<typename T_Element>
29 {
30 LinearTransport () = default;
31 LinearTransport (LinearTransport const &) = default;
35
36 ~LinearTransport () = default;
37
46 void
49 RefPart const & AMREX_RESTRICT ref
50 ) const
51 {
52 static_assert(
53 std::is_base_of_v<LinearTransport, T_Element>,
54 "LinearTransport can only be used as a mixin class!"
55 );
56
57 // small trick to force every derived class has to implement a method transport_map
58 // (w/o using a purely virtual function)
59 T_Element const & element = *static_cast<T_Element const*>(this);
60 cm = element.transport_map(ref) * cm * element.transport_map(ref).transpose();
61 }
62 };
63
64} // namespace impactx::elements::mixin
65
66#endif // IMPACTX_ELEMENTS_MIXIN_LINEAR_TRANSPORT_H
#define AMREX_FORCE_INLINE
#define AMREX_RESTRICT
#define AMREX_GPU_HOST
Definition alignment.H:23
amrex::SmallMatrix< amrex::ParticleReal, 6, 6, amrex::Order::F, 1 > Map6x6
Definition CovarianceMatrix.H:20
Definition ReferenceParticle.H:31
LinearTransport & operator=(LinearTransport const &)=default
LinearTransport(LinearTransport const &)=default
LinearTransport(LinearTransport &&)=default
AMREX_GPU_HOST AMREX_FORCE_INLINE void operator()(Map6x6 &AMREX_RESTRICT cm, RefPart const &AMREX_RESTRICT ref) const
Definition lineartransport.H:47