Skip to content

Commit

Permalink
Transport/Covariane: Use SmallMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l committed Oct 11, 2024
1 parent a9888ce commit 817cc51
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/particles/CovarianceMatrix.H
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
#ifndef IMPACTX_DISTRIBUTION_COVARIANCE_MATRIX_H
#define IMPACTX_DISTRIBUTION_COVARIANCE_MATRIX_H

#include <AMReX_Array.H>
#include <AMReX_REAL.H>
#include <AMReX_SmallMatrix.H>


namespace impactx
{
/** this is a 6x6 matrix */
using CovarianceMatrix = amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6>;
using CovarianceMatrix = amrex::SmallMatrix<amrex::ParticleReal, 6, 6, amrex::Order::F, 1>;

} // namespace impactx::distribution

Expand Down
3 changes: 2 additions & 1 deletion src/particles/elements/Drift.H
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

#include <AMReX_Extension.H>
#include <AMReX_REAL.H>
#include <AMReX_SmallMatrix.H>

#include <cmath>

Expand Down Expand Up @@ -168,7 +169,7 @@ namespace impactx
*/
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE

amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6>
amrex::SmallMatrix<amrex::ParticleReal, 6, 6, amrex::Order::F, 1>
transport_map(RefPart & AMREX_RESTRICT refpart) {

using namespace amrex::literals; // for _rt and _prt
Expand Down
3 changes: 2 additions & 1 deletion src/particles/elements/mixin/lineartransport.H
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <AMReX_Math.H>
#include <AMReX_Extension.H>
#include <AMReX_REAL.H>
#include <AMReX_SmallMatrix.H>


namespace impactx::elements
Expand All @@ -41,7 +42,7 @@ namespace impactx::elements
~LinearTransport () = default;

// 6x6 linear transport map
using Map6x6 = amrex::Array2D<amrex::ParticleReal, 1, 6, 1, 6>;
using Map6x6 = amrex::SmallMatrix<amrex::ParticleReal, 6, 6, amrex::Order::F, 1>;
Map6x6 m_transport_map; ///< linearized map
};

Expand Down

0 comments on commit 817cc51

Please sign in to comment.