WarpX
Toggle main menu visibility
Loading...
Searching...
No Matches
Source
Particles
ExternalParticleFields.H
Go to the documentation of this file.
1
/* Copyright 2025 The WarpX Community
2
*
3
* This file is part of WarpX.
4
*
5
* Authors: S. Diederichs (CERN)
6
*
7
* License: BSD-3-Clause-LBNL
8
*/
9
10
#ifndef WARPX_EXTERNAL_PARTICLE_FIELDS_H_
11
#define WARPX_EXTERNAL_PARTICLE_FIELDS_H_
12
13
#include <
AMReX_Parser.H
>
14
#include <string>
15
#include <vector>
16
#include <memory>
17
18
// /**
19
// * \brief This struct contains the meta data needed to describe a single external particle
20
// * field:
21
// * The name of the field, the path to the file, the time dependency function,
22
// * and then the parser for the time depenendcy function
23
// *
24
// */
25
struct
ParticleFieldMetaData
{
27
std::string
path
;
29
std::string
time_function
=
"1.0"
;
31
std::unique_ptr<amrex::Parser>
time_parser
;
33
amrex::ParserExecutor<1>
time_executor
;
34
};
35
36
// /**
37
// * \brief This class contains the parameters for the external particle fields.
38
// *
39
// */
40
class
ExternalParticleFields
{
41
public
:
42
44
std::vector<ParticleFieldMetaData>
m_E_field_metadata
;
46
std::vector<ParticleFieldMetaData>
m_B_field_metadata
;
48
int
m_nEfields
;
50
int
m_nBfields
;
51
53
// field meta data arrays
54
void
ReadParameters
();
55
};
56
57
#endif
// WARPX_EXTERNAL_PARTICLE_FIELDS_H_
AMReX_Parser.H
ExternalParticleFields
Definition
ExternalParticleFields.H:40
ExternalParticleFields::m_nBfields
int m_nBfields
Number of external B fields.
Definition
ExternalParticleFields.H:50
ExternalParticleFields::m_B_field_metadata
std::vector< ParticleFieldMetaData > m_B_field_metadata
Array of B field metadata.
Definition
ExternalParticleFields.H:46
ExternalParticleFields::ReadParameters
void ReadParameters()
Read in the parameters via the parser and create the external particle.
Definition
ExternalParticleFields.cpp:19
ExternalParticleFields::m_nEfields
int m_nEfields
Number of external E fields.
Definition
ExternalParticleFields.H:48
ExternalParticleFields::m_E_field_metadata
std::vector< ParticleFieldMetaData > m_E_field_metadata
Array of E field metadata.
Definition
ExternalParticleFields.H:44
ParticleFieldMetaData
Definition
ExternalParticleFields.H:25
ParticleFieldMetaData::time_function
std::string time_function
Time dependency function as a string.
Definition
ExternalParticleFields.H:29
ParticleFieldMetaData::path
std::string path
Path to the openPMD file containing the field.
Definition
ExternalParticleFields.H:27
ParticleFieldMetaData::time_parser
std::unique_ptr< amrex::Parser > time_parser
User-defined parser for time dependency of the field.
Definition
ExternalParticleFields.H:31
ParticleFieldMetaData::time_executor
amrex::ParserExecutor< 1 > time_executor
Compiled executor of the parser.
Definition
ExternalParticleFields.H:33
amrex::ParserExecutor
Generated by
1.17.0