Skip to content

Commit

Permalink
better tutorial
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Jan 20, 2025
1 parent b6d165c commit 101031d
Showing 1 changed file with 36 additions and 10 deletions.
46 changes: 36 additions & 10 deletions docs/content/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ Step 3: Mesher
# Run the mesher from the command line
# - geometry.yaml - contains the geometry description (input)
# - voxel.json.gz - contains the meshed voxel structure (output)
pypeec mesher \
--geometry tutorial/geometry.yaml \
--voxel tutorial/voxel.json.gz
Expand All @@ -47,10 +48,15 @@ Step 3: Mesher
# Run the mesher from the Python interpreter
# - geometry.yaml - contains the geometry description (input)
# - voxel.json.gz - contains the meshed voxel structure (output)
import pypeec
file_geometry = "tutorial/geometry.yaml"
file_voxel = "tutorial/voxel.json.gz"
pypeec.run_mesher_file(
"tutorial/geometry.yaml",
"tutorial/voxel.json.gz",
file_geometry=file_geometry,
file_voxel=file_voxel,
)
.. literalinclude:: ../tutorial/log_mesher.txt
Expand All @@ -65,6 +71,7 @@ Step 4: Viewer
# - voxel.json.gz - contains the meshed voxel structure (input)
# - viewer.yaml - contains the plot configuration (input)
# - tag_plot - list of plots to be shown (defined in viewer.yaml)
pypeec viewer \
--voxel tutorial/voxel.json.gz \
--viewer config/viewer.yaml \
Expand All @@ -76,10 +83,15 @@ Step 4: Viewer
# - voxel.json.gz - contains the meshed voxel structure (input)
# - viewer.yaml - contains the plot configuration (input)
# - tag_plot - list of plots to be shown (defined in viewer.yaml)
import pypeec
file_voxel = "tutorial/voxel.json.gz"
file_viewer = "config/viewer.yaml"
pypeec.run_viewer_file(
"tutorial/voxel.json.gz",
"config/viewer.yaml",
file_voxel=file_voxel,
file_viewer=file_viewer,
tag_plot=["domain", "graph"],
)
Expand All @@ -101,6 +113,7 @@ Step 5: Solver
# - problem.yaml - contains the magnetic problem description (input)
# - tolerance.yaml - contains the solver numerical tolerances (input)
# - solution.json.gz - contains the problem solution (output)
pypeec solver \
--voxel tutorial/voxel.json.gz \
--problem tutorial/problem.yaml \
Expand All @@ -114,12 +127,19 @@ Step 5: Solver
# - problem.yaml - contains the magnetic problem description (input)
# - tolerance.yaml - contains the solver numerical tolerances (input)
# - solution.json.gz - contains the problem solution (output)
import pypeec
file_voxel = "tutorial/voxel.json.gz"
file_solution = "tutorial/solution.json.gz"
file_problem = "tutorial/problem.yaml"
file_tolerance = "config/tolerance.yaml"
pypeec.run_solver_file(
"tutorial/voxel.json.gz",
"tutorial/problem.yaml",
"config/tolerance.yaml",
"tutorial/solution.json.gz",
file_voxel=file_voxel,
file_problem=file_problem,
file_tolerance=file_tolerance,
file_solution=file_solution,
)
.. literalinclude:: ../tutorial/log_solver.txt
Expand All @@ -134,6 +154,7 @@ Step 6: Plotter
# - solution.json.gz - contains the problem solution (input)
# - plotter.yaml - contains the plot configuration (input)
# - tag_plot - list of plots to be shown (defined in plotter.yaml)
pypeec plotter \
--solution tutorial/solution.json.gz \
--plotter config/plotter.yaml \
Expand All @@ -145,10 +166,15 @@ Step 6: Plotter
# - solution.json.gz - contains the problem solution (input)
# - plotter.yaml - contains the plot configuration (input)
# - tag_plot - list of plots to be shown (defined in plotter.yaml)
import pypeec
file_solution = "tutorial/solution.json.gz"
file_plotter = "config/plotter.yaml"
pypeec.run_plotter_file(
"tutorial/solution.json.gz",
"config/plotter.yaml",
file_solution=file_solution,
file_plotter=file_plotter,
tag_plot=["V_c_norm", "J_c_norm", "H_p_norm", "residuum"],
)
Expand Down

0 comments on commit 101031d

Please sign in to comment.