API Doc

List of Packages

pypeec

Main PyPEEC package.

pypeec.run

Mesher, solver, viewer, and plotter.

pypeec.utils

Various independent utils for data manipulation.

pypeec.data

Modules containing all the static data.

pypeec.lib_check

Library for checking the integrity of the input data.

pypeec.lib_matrix

Library for handling and manipulating matrices.

pypeec.lib_plot

Modules used by the viewer and plotter.

pypeec.lib_mesher

Modules used by the mesher.

pypeec.lib_solver

Modules used by the solver.

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_geometrydata
  • The dict describes the geometry, meshing and resampling process.

Returns

data_voxeldata
  • The dict describes the meshed voxel structure.

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_geometryfilename
  • The file content describes the geometry, meshing and resampling process.

  • This input file is loaded by this function (JSON or YAML format).

file_voxelfilename
  • The file content describes the meshed voxel structure.

  • This output file is created 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 viewer data as an argument.

Parameters

data_voxeldata
  • The dict describes the meshed voxel structure.

data_viewer: data
  • The dict describes the different plots to be created.

tag_plotlist
  • The list describes plots to be shown.

  • If None or omitted: all the plots are shown.

plot_modestring
  • If “qt”, the Qt framework is used for the rendering.

  • If “nb_int”, interactive plots are rendered within the Jupyter notebook.

  • If “nb_std”, static plots are rendered within the Jupyter notebook.

  • If “save”, the plots are not shown but saved as PNG and VTK files.

  • If “debug”, the plots are not shown (test mode).

  • If None or omitted: the Qt framework is used.

folderstring
  • Folder name for saving the screenshots.

  • If None or omitted: the current directory is used.

namestring
  • Prepended at the beginning of the screenshot filenames.

  • If None or omitted: the original filenames are used.

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 viewer data from a file.

Parameters

file_voxelfilename
  • The file content describes the meshed 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_plotlist
  • The list describes plots to be shown.

  • If None or omitted: all the plots are shown.

plot_modestring
  • If “qt”, the Qt framework is used for the rendering.

  • If “nb_int”, interactive plots are rendered within the Jupyter notebook.

  • If “nb_std”, static plots are rendered within the Jupyter notebook.

  • If “save”, the plots are not shown but saved as PNG and VTK files.

  • If “debug”, the plots are not shown (test mode).

  • If None or omitted: the Qt framework is used.

folderstring
  • Folder name for saving the screenshots.

  • If None or omitted: the current directory is used.

namestring
  • Prepended at the beginning of the screenshot filenames.

  • If None or omitted: the original filenames are used.

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_voxeldata
  • The dict describes the meshed voxel structure.

data_problem: data
  • The dict describes the problem to be solved.

data_tolerance: data
  • The dict describes the numerical options.

Returns

data_solutiondata
  • The dict describes the problem solution.

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_voxelfilename
  • The file content describes the meshed 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_solutionfilename
  • The file content describes the problem solution.

  • This output file is created 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 plotter data as an argument.

Parameters

data_solutiondata
  • The dict describes the problem solution.

data_plotterdata
  • The dict describes the different plots to be created.

tag_sweeplist
  • The list describes the solver sweeps to be shown.

  • If None or omitted: all the sweeps are shown.

tag_plotlist
  • The list describes plots to be shown.

  • If None or omitted: all the plots are shown.

plot_modestring
  • If “qt”, the Qt framework is used for the rendering.

  • If “nb_int”, interactive plots are rendered within the Jupyter notebook.

  • If “nb_std”, static plots are rendered within the Jupyter notebook.

  • If “save”, the plots are not shown but saved as PNG and VTK files.

  • If “debug”, the plots are not shown (test mode).

  • If None or omitted: the Qt framework is used.

folderstring
  • Folder name for saving the screenshots.

  • If None or omitted: the current directory is used.

namestring
  • Prepended at the beginning of the screenshot filenames.

  • If None or omitted: the original filenames are used.

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 plotter data from a file.

Parameters

file_solutionfilename
  • The dict describes the problem solution.

  • This input file is loaded by this function (JSON or Pickle format).

file_plotterfilename
  • The dict describes the different plots to be created.

  • This input file is loaded by this function (JSON or YAML format).

tag_sweeplist
  • The list describes the solver sweeps to be shown.

  • If None or omitted: all the sweeps are shown.

tag_plotlist
  • The list describes plots to be shown.

  • If None or omitted: all the plots are shown.

plot_modestring
  • If “qt”, the Qt framework is used for the rendering.

  • If “nb_int”, interactive plots are rendered within the Jupyter notebook.

  • If “nb_std”, static plots are rendered within the Jupyter notebook.

  • If “save”, the plots are not shown but saved as PNG and VTK files.

  • If “debug”, the plots are not shown (test mode).

  • If None or omitted: the Qt framework is used.

folderstring
  • Folder name for saving the screenshots.

  • If None or omitted: the current directory is used.

namestring
  • Prepended at the beginning of the screenshot filenames.

  • If None or omitted: the original filenames are used.

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

argvlist
  • List with the command line arguments.

Returns

statusint
  • The status exit code of the script.

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()” and a status exit code.