WARPXM v1.10.0
|
Warpy is a Python interface for setting up and running WARPXM simulations.
Features:
To get started using warpy, import the warpy package
Note: The path to warpy must be in your PYTHONPATH (see install instructions).
TODO: Make warpy an installable package with pip.
The warpy_user_config.py
file contains common user-adjustable settings for running WARPXM simulations with warpy, such as number of MPI process, where to place simulation run directories, and queue names on HPC clusters, to name a few.
Warpy will look for the user config file in $HOME/.config
. If it is not already there, warpy will copy a default version to that location.
Configuration options are regularly added. Please see warpy_user_config.py for current options and description of use.
See warpy developer information.
WARPXM simulations are setup based on instructions provided in an xml-like formatted input file with the extension .inp
(see input file documentation for more details). These input files become long and difficult to read, even for modestly complex simulations. Warpy was developed to set up WARPXM simulations in a more intuitive, object-oriented way, as well as automate directory set up, copying of useful files, and performing some basic post processing. Warpy can also automate the submission of jobs on HPC machines.
The next section discusses the creation of a WARPXM simulation input file using the warpy library.
WARPy is a regular Python package; that means you can do anything Python lets you do. The general process for writing a warpy script is:
WARPXM/WARPy allows defining two different types of meshes: rectangular block generated meshes, or Abaqus meshes. Periodic boundaries are associated topologically with meshes, so these are specified at this stage rather than when you specify other boundary conditions. This is done by specifying pairs of nodesets are periodic.
Variables represent a collection of scalar components expressed on some basis. They can be restricted to particular subdomains, as well as defined to exist virtually on a subdomain. A variable can also be defined to be explodable or not. Explodable variables are expanded depending on the number of stages required to implement a particular RK method; non-explodable variables only exist once. An example usage of non-explodable variables is implementing a static electric field while evolving other variables' response. By default if no subdomains are specified the variable exists globally in the domain.
TODO: This section is out-of-date. Needs updating.
Initial conditions are defined in two stages: first by creating a functional operation, then creating an applicator to apply the function to a variable. You can re-use previously defined function operations multiple times to initialize different variables. When creating applicators, you can specify a few components, or use the default which passes in all components.
Applications in warpy.apps
are used to implement the physics of a particular model. See the individual apps for what parameters to pass. You can define a spatial solver to be restricted to certain subdomains.
The writer defines what data to export and how. There are two primary types of writers:
WriteInterval
argument). The variables are exported only on the subdomains where they exist. Non-periodic boundary conditions are defined using applications in warpy.apps
. Once the apps are defined, they can be added to a boundary condition variable adjuster to restrict them to a given subdomain.
There are two type of temporal solvers currently supported by WARPXM: explicit and implicit Runge-Kutta schemes. These are both host actions.
The timestep controller defines how the timestep can be updated (or not), as well as determining if a timestep needs to be re-tried.
The DG simulation object ties everything together, and represents the entire input file. There are a lot of extra optional parameters for configuring a simulation.
The simulation object can be used to generate a directory where WARPXM will be run for a given test case. If gen_xdmf=True
, then an XDMF file will be generated which can be used to post-process in ParaView or VisIt. Note that if VisIt is being used, then you need detect_nonscalar
to be set to false.
When making modifications to warpy, it is a good idea to review that the generated WARPXM input file is being populated as expected.
For more targeted debugging, warpy objects can also be printed out individually as a string using the generate
member function to get an idea of what the generated input file section would look like. Note that this may not work as intended for applications, since these depend on a variable index map which is generated from the associated spatial solver/variable adjuster. If you print out an application directly it will generate a dummy components map to use for indices. Once a spatial solver/variable adjuster has been added to a temporal solver it should have the correct variable index mapping.
See this user guide on things to consider when setting up a multiphysics plasma simulation with WARPXM.
A collection of example warpy input files can be found in the examples folder.
Recommended examples include: