API Doc

Main Packages

pypeec

Main PyPEEC package.

pypeec.run

Mesher, solver, viewer, and plotter.

pypeec.utils

Various independent utils for data manipulation.

pypeec.lib_check

Library for checking the integrity of the input data.

pypeec.lib_matrix

Library for handling and manipulating matrices.

pypeec.lib_mesher

Modules used by the mesher.

pypeec.lib_solver

Modules used by the solver.

pypeec.lib_visualization

Modules used by the viewer and plotter.

pypeec.data

Modules containing the static data.

Mesher Function

pypeec.run_mesher_data(data_geometry)
Main script for meshing the geometry and generating a 3D voxel structure.
  • Get the geometry data as an argument.

  • Return the created voxel data.

Parameters:

data_geometry (data) – The dict describes the geometry, meshing and resampling process.

Returns:

data_voxel – The dict describes the voxel structure.

Return type:

data

pypeec.run_mesher_file(file_geometry, file_voxel)
Main script for meshing the geometry and generating a 3D voxel structure.
  • Load the geometry data from a file.

  • Write the created voxel data in a file.

Parameters:
  • file_geometry (filename) – The file content describes the geometry, meshing and resampling process. This input file is loaded by this function (JSON or YAML format).

  • file_voxel (filename) – The file content describes the voxel structure. This output file is written by this function (JSON or Pickle format).

Viewer Function

pypeec.run_viewer_data(data_voxel, data_viewer, **kwargs)
Main script for visualizing a 3D voxel structure.
  • Get the voxel data as an argument.

  • Get the point data as an argument.

  • Get the viewer data as an argument.

Parameters:
  • data_voxel (data) – The dict describes the voxel structure.

  • data_viewer (data) – The dict describes the different plots to be created.

  • tag_plot (list) – The list describes plots to be shown. If None, all the plots are shown (default). This argument is optional.

  • plot_mode (string) – If “qt”, the Qt framework is used for the rendering (default). If “nb”, the plots are rendered within the Jupyter notebook. If “save”, the plots are not shown but saved as screenshots. If “none”, the plots are not shown (test mode). This argument is optional.

  • folder (string) – Folder name for saving the screenshots. The current directory is used as the default directory. This argument is optional.

  • name (string) – Prepended at the beginning of the screenshot filenames. This argument is optional.

pypeec.run_viewer_file(file_voxel, file_viewer, **kwargs)
Main script for visualizing a 3D voxel structure.
  • Load the voxel data from a file.

  • Load the point data from a file.

  • Load the viewer data from a file.

Parameters:
  • file_voxel (filename) – The file content describes the voxel structure. This input file is loaded by this function (JSON or Pickle format).

  • file_viewer (filename) – The file content describes the different plots to be created. This input file is loaded by this function (JSON or YAML format).

  • tag_plot (list) – The list describes plots to be shown. If None, all the plots are shown (default). This argument is optional.

  • plot_mode (string) – If “qt”, the Qt framework is used for the rendering (default). If “nb”, the plots are rendered within the Jupyter notebook. If “save”, the plots are not shown but saved as screenshots. If “none”, the plots are not shown (test mode). This argument is optional.

  • folder (string) – Folder name for saving the screenshots. The current directory is used as the default directory. This argument is optional.

  • name (string) – Prepended at the beginning of the screenshot filenames. This argument is optional.

Solver Function

pypeec.run_solver_data(data_voxel, data_problem, data_tolerance)
Main script for solving a problem with the PEEC solver.
  • Get the voxel data as an argument.

  • Get the problem data as an argument.

  • Get the tolerance data as an argument.

  • Return the created solution data.

Parameters:
  • data_voxel (data) – The dict describes the voxel structure.

  • data_problem (data) – The dict describes the problem to be solved.

  • data_tolerance (data) – The dict describes the numerical options.

Returns:

data_solution – The dict describes the problem solution.

Return type:

data

pypeec.run_solver_file(file_voxel, file_problem, file_tolerance, file_solution)
Main script for solving a problem with the PEEC solver.
  • Load the voxel data from a file.

  • Load the problem data from a file.

  • Load the tolerance data from a file.

  • Write the created solution data in a file.

Parameters:
  • file_voxel (filename) – The file content describes the voxel structure. This input file is loaded by this function (JSON or Pickle format).

  • file_problem (filename) – The file content describes the problem to be solved. This input file is loaded by this function (JSON or YAML format).

  • file_tolerance (filename) – The file content describes the numerical options. This input file is loaded by this function (JSON or YAML format).

  • file_solution (filename) – The file content describes the problem solution. This output file is written by this function (JSON or Pickle format).

Plotter Function

pypeec.run_plotter_data(data_solution, data_plotter, **kwargs)
Main script for plotting the solution of a PEEC problem.
  • Get the solution data as an argument.

  • Get the point data as an argument.

  • Get the plotter data as an argument.

Parameters:
  • data_solution (data) – The dict describes the problem solution.

  • data_plotter (data) – The dict describes the different plots to be created.

  • tag_sweep (list) – The list describes sweeps to be shown. If None, all the sweeps are shown (default). This argument is optional.

  • tag_plot (list) – The list describes plots to be shown. If None, all the plots are shown (default). This argument is optional.

  • plot_mode (string) – If “qt”, the Qt framework is used for the rendering (default). If “nb”, the plots are rendered within the Jupyter notebook. If “save”, the plots are not shown but saved as screenshots. If “none”, the plots are not shown (test mode). This argument is optional.

  • folder (string) – Folder name for saving the screenshots. The current directory is used as the default directory. This argument is optional.

  • name (string) – Prepended at the beginning of the screenshot filenames. This argument is optional.

pypeec.run_plotter_file(file_solution, file_plotter, **kwargs)
Main script for plotting the solution of a PEEC problem.
  • Load the solution data from a file.

  • Load the point data from a file.

  • Load the plotter data from a file.

Parameters:
  • file_solution (filename) – The dict describes the problem solution. This input file is loaded by this function (JSON or Pickle format).

  • file_plotter (filename) – The dict describes the different plots to be created. This input file is loaded by this function (JSON or YAML format).

  • tag_sweep (list) – The list describes sweeps to be shown. If None, all the sweeps are shown (default). This argument is optional.

  • tag_plot (list) – The list describes plots to be shown. If None, all the plots are shown (default). This argument is optional.

  • plot_mode (string) – If “qt”, the Qt framework is used for the rendering (default). If “nb”, the plots are rendered within the Jupyter notebook. If “save”, the plots are not shown but saved as screenshots. If “none”, the plots are not shown (test mode). This argument is optional.

  • folder (string) – Folder name for saving the screenshots. The current directory is used as the default directory. This argument is optional.

  • name (string) – Prepended at the beginning of the screenshot filenames. This argument is optional.

Command Line

pypeec.run_arguments(argv)
User script for running PyPEEC with given arguments.
  • The script offers a CLI for the mesher, solver, viewer, and plotter.

  • The script can also be used to extract data (examples or documentation).

Parameters:

argv (list) – List with the command line arguments.

Returns:

status – The status exit code of the script.

Return type:

int

pypeec.run_script()
User script for running PyPEEC with the command line arguments.
  • The script offers a CLI for the mesher, solver, viewer, and plotter.

  • The script can also be used to extract data (examples or documentation).

The script is installed with the package. The name of the command line script is “pypeec”. Exit the program with “sys.exit()” with a status code.