Commit 2dd480d9 authored by Pacôme Armagnat's avatar Pacôme Armagnat
Browse files

Add verbose option in solver to disable prints in define_mixed_points_type

parent 143d8abf
......@@ -503,7 +503,8 @@ class LinearProblem(object):
mixed_val=None, pos_voltage_mixed=None,
pos_charge_mixed=None, is_charge_density=True,
check_rhs=False, check_lhs=False, check_capa_mat=False,
build_equations=True, solve_problem=True, solver='mumps'):
build_equations=True, solve_problem=True, verbose=False,
solver='mumps'):
'''
Parameters:
discrete_poisson: Object from Discretize Poisson
......@@ -600,6 +601,10 @@ class LinearProblem(object):
when initializing the class. By default True.
Default solver -> solve_mumps()
verbose: bool
if True, print additionnal info when
define_mixed_points_type is called
solver: str
Can be:'mumps' -> uses kwant.linlag.mumps
'spsolve' -> uses scipy.sparse.linlag.dsolve.spsolve
......@@ -654,6 +659,8 @@ class LinearProblem(object):
self.solver = None
self.solver_instance = None
self.verbose = verbose
if build_equations:
self.build()
......@@ -766,19 +773,20 @@ class LinearProblem(object):
self.discrete_poisson.points_system_mixed,
np.arange(len(self.discrete_poisson.points_system_mixed))[
intersected_mixed_map])
if len(pos_default_mixed) > 1:
print('\n')
print('#'*48)
print('\n')
warnings.warn((
'\n \n There are points belonging to mixed regions that'
+ ' are not defined in pos_dirichlet_mixed nor'
+ ' pos_neuman_mixed. \n To those points'
+ ' the default charge value will be associated'
+ ', i.e. 0 \n'),
UserWarning)
print('\n')
print('#'*48)
if self.verbose:
if len(pos_default_mixed) > 1:
print('\n')
print('#'*48)
print('\n')
warnings.warn((
'\n \n There are points belonging to mixed regions that'
+ ' are not defined in pos_dirichlet_mixed nor'
+ ' pos_neuman_mixed. \n To those points'
+ ' the default charge value will be associated'
+ ', i.e. 0 \n'),
UserWarning)
print('\n')
print('#'*48)
self.pos_charge_mixed = np.concatenate((
self.pos_charge_mixed,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment