Skip to content

Commit b2b5c5f

Browse files
authored
Move multigrid example scripts into pyro/ (#141)
Fixes #140.
1 parent 4c90ee6 commit b2b5c5f

16 files changed

Lines changed: 27 additions & 51 deletions

docs/source/multigrid_basics.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ A basic multigrid test is run as (using a path relative to the root of the
4141

4242
.. prompt:: bash
4343

44-
./examples/multigrid/mg_test_simple.py
44+
./pyro/multigrid/examples/mg_test_simple.py
4545

4646
The ``mg_test_simple.py`` script solves a Poisson equation with a
4747
known analytic solution. This particular example comes from the text
@@ -86,7 +86,7 @@ You can run this example locally by running the ``mg_vis.py`` script:
8686

8787
.. prompt:: bash
8888

89-
./examples/multigrid/mg_vis.py
89+
./pyro/multigrid/examples/mg_vis.py
9090

9191
projection
9292
^^^^^^^^^^
@@ -96,7 +96,7 @@ field. This is run as:
9696

9797
.. prompt:: bash
9898

99-
./examples/multigrid/project_periodic.py
99+
./pyro/multigrid/examples/project_periodic.py
100100

101101
Given a vector field, :math:`U`, we can decompose it into a divergence free part, :math:`U_d`, and the gradient of a scalar, :math:`\phi`:
102102

examples/__init__.py

Lines changed: 0 additions & 1 deletion
This file was deleted.

examples/multigrid/mg_test_general_alphabeta_only.py renamed to pyro/multigrid/examples/mg_test_general_alphabeta_only.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@
2929
"""
3030

3131

32-
import os
33-
3432
import matplotlib.pyplot as plt
3533
import numpy as np
3634

37-
from pyro.util import compare
3835
import pyro.mesh.boundary as bnd
39-
import pyro.mesh.patch as patch
4036
import pyro.multigrid.general_MG as MG
4137
import pyro.util.io_pyro as io
42-
import pyro.util.msg as msg
38+
from pyro.mesh import patch
39+
from pyro.util import compare, msg
4340

4441

4542
# the analytic solution

examples/multigrid/mg_test_general_beta_only.py renamed to pyro/multigrid/examples/mg_test_general_beta_only.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,14 @@
2929
"""
3030

3131

32-
import os
33-
3432
import matplotlib.pyplot as plt
3533
import numpy as np
3634

37-
from pyro.util import compare
3835
import pyro.mesh.boundary as bnd
39-
import pyro.mesh.patch as patch
4036
import pyro.multigrid.general_MG as MG
4137
import pyro.util.io_pyro as io
42-
import pyro.util.msg as msg
38+
from pyro.mesh import patch
39+
from pyro.util import compare, msg
4340

4441

4542
# the analytic solution

examples/multigrid/mg_test_general_constant.py renamed to pyro/multigrid/examples/mg_test_general_constant.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,14 @@
1616
"""
1717

1818

19-
import os
20-
2119
import matplotlib.pyplot as plt
2220
import numpy as np
2321

24-
from pyro.util import compare
2522
import pyro.mesh.boundary as bnd
26-
import pyro.mesh.patch as patch
2723
import pyro.multigrid.general_MG as MG
2824
import pyro.util.io_pyro as io
29-
import pyro.util.msg as msg
25+
from pyro.mesh import patch
26+
from pyro.util import compare, msg
3027

3128

3229
# the analytic solution

examples/multigrid/mg_test_general_dirichlet.py renamed to pyro/multigrid/examples/mg_test_general_dirichlet.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,14 @@
3333
"""
3434

3535

36-
import os
37-
3836
import matplotlib.pyplot as plt
3937
import numpy as np
4038

41-
from pyro.util import compare
4239
import pyro.mesh.boundary as bnd
43-
import pyro.mesh.patch as patch
4440
import pyro.multigrid.general_MG as MG
4541
import pyro.util.io_pyro as io
46-
import pyro.util.msg as msg
42+
from pyro.mesh import patch
43+
from pyro.util import compare, msg
4744

4845

4946
# the analytic solution

examples/multigrid/mg_test_general_inhomogeneous.py renamed to pyro/multigrid/examples/mg_test_general_inhomogeneous.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,14 @@
3838
"""
3939

4040

41-
import os
42-
4341
import matplotlib.pyplot as plt
4442
import numpy as np
4543

46-
from pyro.util import compare
4744
import pyro.mesh.boundary as bnd
48-
import pyro.mesh.patch as patch
4945
import pyro.multigrid.general_MG as MG
5046
import pyro.util.io_pyro as io
51-
import pyro.util.msg as msg
47+
from pyro.mesh import patch
48+
from pyro.util import compare, msg
5249

5350

5451
# the analytic solution
Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,12 @@
1515
"""
1616

1717

18-
import os
19-
2018
import matplotlib.pyplot as plt
2119
import numpy as np
2220

23-
from pyro.util import compare
24-
import pyro.multigrid.MG as MG
2521
import pyro.util.io_pyro as io
26-
import pyro.util.msg as msg
22+
from pyro.multigrid import MG
23+
from pyro.util import compare, msg
2724

2825

2926
# the analytic solution

examples/multigrid/mg_test_vc_constant.py renamed to pyro/multigrid/examples/mg_test_vc_constant.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@
2222
import numpy as np
2323

2424
import pyro.mesh.boundary as bnd
25-
import pyro.mesh.patch as patch
2625
import pyro.multigrid.variable_coeff_MG as MG
26+
from pyro.mesh import patch
2727

2828

2929
# the analytic solution

0 commit comments

Comments
 (0)