Skip to content

Commit 61b4919

Browse files
committed
Fix compile-time errors.
1 parent 6d09dc2 commit 61b4919

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

src/elements/Quad.H

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -299,26 +299,26 @@ namespace impactx::elements
299299
* @param px particle momentum in x
300300
* @param py particle momentum in y
301301
* @param pt particle momentum in t
302+
* @param idcpu particle global index
303+
* @param refpart reference particle (unused)
302304
* @param sx particle spin x-component
303305
* @param sy particle spin y-component
304306
* @param sz particle spin z-component
305-
* @param idcpu particle global index
306-
* @param refpart reference particle (unused)
307307
*/
308308
template<typename T_Real=amrex::ParticleReal, typename T_IdCpu=uint64_t>
309309
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE
310310
void operator() (
311-
T_Real & AMREX_RESTRICT x,
312-
T_Real & AMREX_RESTRICT y,
313-
T_Real & AMREX_RESTRICT t,
314-
T_Real & AMREX_RESTRICT px,
315-
T_Real & AMREX_RESTRICT py,
316-
T_Real & AMREX_RESTRICT pt,
311+
[[maybe_unused]] T_Real & AMREX_RESTRICT x,
312+
[[maybe_unused]] T_Real & AMREX_RESTRICT y,
313+
[[maybe_unused]] T_Real & AMREX_RESTRICT t,
314+
[[maybe_unused]] T_Real & AMREX_RESTRICT px,
315+
[[maybe_unused]] T_Real & AMREX_RESTRICT py,
316+
[[maybe_unused]] T_Real & AMREX_RESTRICT pt,
317+
[[maybe_unused]] T_IdCpu & AMREX_RESTRICT idcpu,
318+
[[maybe_unused]] RefPart const & AMREX_RESTRICT refpart,
317319
T_Real & AMREX_RESTRICT sx,
318320
T_Real & AMREX_RESTRICT sy,
319-
T_Real & AMREX_RESTRICT sz,
320-
T_IdCpu & AMREX_RESTRICT idcpu,
321-
[[maybe_unused]] RefPart const & AMREX_RESTRICT refpart
321+
T_Real & AMREX_RESTRICT sz
322322
) const
323323
{
324324
using namespace amrex::literals; // for _rt and _prt
@@ -340,11 +340,11 @@ namespace impactx::elements
340340
amrex::ParticleReal const omega = std::sqrt(std::abs(m_k));
341341

342342
// compute trigonometric quantities
343-
sin_omega_ds = std::sin(omega*m_slice_ds);
344-
cos_omega_ds = std::cos(omega*m_slice_ds);
345-
sinh_omega_ds = std::sinh(omega*m_slice_ds);
346-
cosh_omega_ds = std::cosh(omega*m_slice_ds);
347-
343+
amrex::ParticleReal const sin_omega_ds = std::sin(omega*slice_ds);
344+
amrex::ParticleReal const cos_omega_ds = std::cos(omega*slice_ds);
345+
amrex::ParticleReal const sinh_omega_ds = std::sinh(omega*slice_ds);
346+
amrex::ParticleReal const cosh_omega_ds = std::cosh(omega*slice_ds);
347+
348348
if (m_k > 0.0_prt)
349349
{
350350

src/elements/mixin/spintransport.H

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,9 @@ namespace impactx::elements::mixin
5252
amrex::ParticleReal angle = std::sqrt(lambdax*lambdax+lambday*lambday+lambdaz*lambdaz);
5353
auto const [sin_half_angle, cos_half_angle] = amrex::Math::sincos(angle/2_prt);
5454
amrex::ParticleReal w0 = cos_half_angle;
55-
amrex::ParticleReal w1 = (theta==0_prt) ? 0_prt : -(lambdax/theta)*sin_half_angle;
56-
amrex::ParticleReal w2 = (theta==0_prt) ? 0_prt : -(lambday/theta)*sin_half_angle;
57-
amrex::ParticleReal w3 = (theta==0_prt) ? 0_prt : -(lambdaz/theta)*sin_half_angle;
55+
amrex::ParticleReal w1 = (angle==0_prt) ? 0_prt : -(lambdax/angle)*sin_half_angle;
56+
amrex::ParticleReal w2 = (angle==0_prt) ? 0_prt : -(lambday/angle)*sin_half_angle;
57+
amrex::ParticleReal w3 = (angle==0_prt) ? 0_prt : -(lambdaz/angle)*sin_half_angle;
5858

5959
// Apply rotation
6060
amrex::ParticleReal sxout = (1_prt-2_prt*(w2*w2+w3*w3))*sx + 2_prt*(w1*w2+w0*w3)*sy + 2_prt*(w1*w3-w0*w2)*sz;

0 commit comments

Comments
 (0)