Package solvcon :: Module solver :: Class BlockSolver
[hide private]
[frames] | no frames]

Class BlockSolver

source code


Generic class for multi-dimensional (implemented with Block) sequential/parallel solvers. Meta, metric, and connectivity data arrays are absorbed into the instance of this class.

Before the invocation of init() method, bind() method must be called.


Note: When subclass BlockSolver, in the init() method in the subclass must be initilized first, and the super().init() can then be called. Otherwise the BCs can't set correct information to the solver.

Nested Classes [hide private]

Inherited from BaseSolver: __metaclass__, _exedatatype_

Instance Methods [hide private]
 
__init__(self, blk, *args, **kw)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
bind(self)
Bind all the boundary condition objects.
source code
 
boundcond(self)
Update the boundary conditions.
source code
 
call_non_interface_bc(self, name, *args, **kw)
Call method of each of non-interface BC objects in my list.
source code
 
exchangeibc(self, arrname, worker=None) source code
 
init(self, **kw)
Check and initialize BCs.
source code
 
init_exchange(self, ifacelist) source code
 
pull(self, arrname, inder=False, worker=None)
Pull data array to dealer (rpc) through worker object.
source code
 
pullank(self, ankname, objname, worker=None)
Pull data array to dealer (rpc) through worker object.
source code
 
pullibc(self, arrname, bc, sendn, worker=None)
Pull data from the interface determined by the serial of peer.
source code
 
push(self, marr, arrname, start=0, inder=False)
Push data array received from dealer (rpc) into self.
source code
 
pushibc(self, arrname, bc, recvn, worker=None)
Push data toward selected interface which connect to blocks with larger serial number than myself.
source code
 
remote_setattr(self, name, var)
Remotely set attribute of worker.
source code
 
unbind(self)
Unbind all the boundary condition objects.
source code

Inherited from BaseSolver: dump, exhaust, final, march, postloop, preloop, provide

Inherited from BaseSolver (private): _set_time, _tcall

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Static Methods [hide private]

Inherited from BaseSolver: detect_ncore

Class Variables [hide private]
  CLMFC = 6
  CLMND = 8
  FCMND = 4
  _interface_init_ = []
list of attributes (arrays) to be exchanged on interface when initialized.
  _solution_array_ = []

Inherited from BaseSolver: MESG_FILENAME_DEFAULT, MMNAMES, _pointers_

Inherited from BaseSolver (private): _clib_solve

Instance Variables [hide private]
  all_simplex
True if the mesh is all-simplex, False otherwise.
  bclist
list of BCs.
  grpnames
list of names of groups.
  ibclist
list of interface BCs.
  ibcthread
flag if using threads.
  ngroup
number of groups.
  nsvr
number of solver objects.
  svrn
serial number of solver object.
  use_incenter
True if the mesh uses incenters, False otherwise.
Properties [hide private]
  is_bound
Check boundness for solver as well as BC objects.
  is_unbound
Check unboundness for solver as well as BC objects.
  ust

Inherited from BaseSolver: fpdtype, fpdtypestr

Inherited from BaseSolver (private): _clib_solvcon

Inherited from object: __class__

Method Details [hide private]

__init__(self, blk, *args, **kw)
(Constructor)

source code 

x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

bind(self)

source code 

Bind all the boundary condition objects.

Returns:
nothing
Overrides: BaseSolver.bind

Note: BC must be bound AFTER solver "pointers". Overridders to the method should firstly bind all pointers, secondly super binder, and then methods/subroutines.

boundcond(self)

source code 

Update the boundary conditions.

Returns:
nothing.

call_non_interface_bc(self, name, *args, **kw)

source code 

Call method of each of non-interface BC objects in my list.

Parameters:
  • name (str) - name of the method of BC to call.
Returns:
nothing

init(self, **kw)

source code 

Check and initialize BCs.

Overrides: BaseSolver.init

pull(self, arrname, inder=False, worker=None)

source code 

Pull data array to dealer (rpc) through worker object.

Parameters:
  • arrname (str) - the array to pull to master.
  • inder (bool) - the data array is derived data array.
  • worker (solvcon.rpc.Worker) - the worker object for communication.
Returns:
nothing.

pullank(self, ankname, objname, worker=None)

source code 

Pull data array to dealer (rpc) through worker object.

Parameters:
  • ankname (str) - the name of related anchor.
  • objname (str) - the object to pull to master.
  • worker (solvcon.rpc.Worker) - the worker object for communication.
Returns:
nothing.

pullibc(self, arrname, bc, sendn, worker=None)

source code 

Pull data from the interface determined by the serial of peer.

Parameters:
  • arrname (str) - name of the array in the object to exchange.
  • bc (solvcon.boundcond.interface) - the interface BC to pull.
  • sendn (int) - serial number of the peer to exchange data with.
  • worker (solvcon.rpc.Worker) - the wrapping worker object for parallel processing.

push(self, marr, arrname, start=0, inder=False)

source code 

Push data array received from dealer (rpc) into self.

Parameters:
  • marr (numpy.ndarray) - the array passed in.
  • arrname (str) - the array to pull to master.
  • start (int) - the starting index of pushing.
  • inder (bool) - the data array is derived data array.
Returns:
nothing.

pushibc(self, arrname, bc, recvn, worker=None)

source code 

Push data toward selected interface which connect to blocks with larger serial number than myself.

Parameters:
  • arrname (str) - name of the array in the object to exchange.
  • bc (solvcon.boundcond.interface) - the interface BC to push.
  • recvn (int) - serial number of the peer to exchange data with.
  • worker (solvcon.rpc.Worker) - the wrapping worker object for parallel processing.

unbind(self)

source code 

Unbind all the boundary condition objects.

Overrides: gendata.unbind

Property Details [hide private]

is_bound

Check boundness for solver as well as BC objects.

Get Method:
unreachable.is_bound(self) - Check boundness for solver as well as BC objects.

is_unbound

Check unboundness for solver as well as BC objects.

Get Method:
unreachable.is_unbound(self) - Check unboundness for solver as well as BC objects.

ust

Get Method:
unreachable.ust(self)