WarpX
Loading...
Searching...
No Matches
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// */
27 std::string path;
29 std::string time_function = "1.0";
31 std::unique_ptr<amrex::Parser> time_parser;
34};
35
36// /**
37// * \brief This class contains the parameters for the external particle fields.
38// *
39// */
41public:
42
44 std::vector<ParticleFieldMetaData> m_E_field_metadata;
46 std::vector<ParticleFieldMetaData> m_B_field_metadata;
51
53 // field meta data arrays
54 void ReadParameters();
55};
56
57#endif // WARPX_EXTERNAL_PARTICLE_FIELDS_H_
This class contains the parameters for the external particle fields.
Definition ExternalParticleFields.H:40
int m_nBfields
Number of external B fields.
Definition ExternalParticleFields.H:50
std::vector< ParticleFieldMetaData > m_B_field_metadata
Array of B field metadata.
Definition ExternalParticleFields.H:46
void ReadParameters()
Read in the parameters via the parser and create the external particle.
Definition ExternalParticleFields.cpp:21
int m_nEfields
Number of external E fields.
Definition ExternalParticleFields.H:48
std::vector< ParticleFieldMetaData > m_E_field_metadata
Array of E field metadata.
Definition ExternalParticleFields.H:44
This struct contains the meta data needed to describe a single external particle field: The name of t...
Definition ExternalParticleFields.H:25
std::string time_function
Time dependency function as a string.
Definition ExternalParticleFields.H:29
std::string path
Path to the openPMD file containing the field.
Definition ExternalParticleFields.H:27
std::unique_ptr< amrex::Parser > time_parser
User-defined parser for time dependency of the field.
Definition ExternalParticleFields.H:31
amrex::ParserExecutor< 1 > time_executor
Compiled executor of the parser.
Definition ExternalParticleFields.H:33