Пример #1
0
import argparse

import numpy as np
import scipy

import io_util
import problems
import problems.boundary


from abcoef import calc_a_coef

parser = argparse.ArgumentParser()

io_util.add_arguments(parser, ("problem", "boundary"))
args = parser.parse_args()

problem = problems.problem_dict[args.problem]()
boundary = problems.boundary.boundaries[args.boundary](problem.R)

M = 7

# print('m1 =', m1)
print("m_max =", problem.m_max)
print()

k = problem.k
R = problem.R
a = problem.a
nu = problem.nu
Пример #2
0
import argparse

import numpy as np

import ps.ps

import io_util
import problems
import problems.boundary

import copy
from multiprocessing import Pool

parser = argparse.ArgumentParser()

io_util.add_arguments(parser, ('problem', 'N'))
args = parser.parse_args()

problem = problems.problem_dict[args.problem]()
boundary = problems.boundary.OuterSine(problem.R)
problem.boundary = boundary

# Options to pass to the solver
options = {
    'problem': problem,
    'N': args.N,
    'scheme_order': 4,
}

meta_options = {
    'procedure_name': 'optimize_basis',
Пример #3
0
    N = N0
    while N <= c:
        N_list.append(N)
        N *= 2

    return N_list


"""
Create an ArgumentParser for handling command-line arguments.
"""
parser = argparse.ArgumentParser()
parser = parser

arg_list = ['problem', 'boundary', 'N', 'c', 'o', 'r', 'a']
io_util.add_arguments(parser, arg_list)

parser.add_argument('--acheat', action='store_true',
    help='for testing purposes. Uses the true-ish values of the a/b '
    'coefficients, which really should not be known')

args = parser.parse_args()

problem = problems.problem_dict[args.problem]()
boundary = problems.boundary.boundaries[args.boundary](problem.R, k=problem.k)
problem.set_boundary(boundary)

N_list = get_N_list(args.N, args.c)

# Options to pass to the solver
options = {
Пример #4
0
import argparse

import numpy as np
import scipy

import io_util
import problems
import problems.boundary

import ps.coordinator

from star.shared import calc_a_coef

parser = argparse.ArgumentParser()

io_util.add_arguments(parser, ('problem', 'boundary'))
args = parser.parse_args()

problem = problems.problem_dict[args.problem]()
boundary = problems.boundary.boundaries[args.boundary](problem.R)

#coord = ps.coordinator.Coordinator(problem, None, {'boundary': boundary})
#coord.print_info()

m1 = 140
M = 7

print('m1 =', m1)
print('m_max =', problem.m_max)
print()
Пример #5
0
        label_text = '$\gamma_{}$'.format(sidmap[sid])
        plt.plot(x_data, y_data, markers[sid], label=label_text,
            mfc=mfc[sid], mec=colors[sid], mew=1,
            ms=ms[sid])

    #plt.title('$\gamma$ nodes')
    #plt.xlim(-4,4)
    #plt.ylim(-4,4)
    #plt.legend(loc=3)


parser = argparse.ArgumentParser()
parser.add_argument('method', choices=('gamma', 'pert', 'm', 'k', 'aux',
    'int', 'ext'))
io_util.add_arguments(parser, ('boundary', 'N'))
args = parser.parse_args()

# Dummy problem just to get the solver to run
problem = Smooth_Sine()
boundary = problems.boundary.boundaries[args.boundary](problem.R)
problem.boundary = boundary

options = {'problem': problem, 'boundary': boundary, 'N': args.N,
    'scheme_order': 4}
solver = ps.ps.PizzaSolver(options)


if args.method == 'gamma':
    plot_aux(options={'color': 'black'})
    plot_gamma()