Package solvcon :: Module boundcond :: Class Glue
[hide private]
[frames] | no frames]

Class Glue

source code


Glue two boundary conditions which are considered to be collocated.

Instance Methods [hide private]
 
__init__(self, sbc, dbc, ref=None, reciprocal=None)
The constructor will create a PAIR of Glue objects attached to the input source BC object (sbc) and destination BC object (dbc).
source code
 
enable(self, *args, **kw)
Enable this glue by setting ghost information from interior and store original values in a cache.
source code
 
disable(self, *args, **kw)
Disable this glue by restoring ghost information from cached values.
source code
 
take(self, key)
Take array values from interior cells to ghost cells.
source code

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

Static Methods [hide private]
numpy.ndarray
__sortfcs(bc, ref)
Get the sorted face list of a BC object according to the reference point.
source code
Class Variables [hide private]
  CACHE_KEYS_ENABLER = ('cltpn', 'clgrp', 'clvol', 'clcnd')
names of arrays whose original values to be cached when the glue is enabled.
Instance Variables [hide private]
  cache
cache for mesh data.
  dcls
destination cell list shifted by ngstcell.
  reciprocal
the glue object on the other side.
  ref
a reference point for matching bounding faces.
  sbc
source BC object.
  scls
source cell list shifted by ngstcell.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, sbc, dbc, ref=None, reciprocal=None)
(Constructor)

source code 

The constructor will create a PAIR of Glue objects attached to the input source BC object (sbc) and destination BC object (dbc). Each Glue object in the pair is the reciprocal of the other. The constructor DOES NOT modify associated BC or BlockSolver objects except setting BC objects' glue property to self. If no reference point is given through ref keyword, a random reference point is generated for sorting boundary faces to be glued.

Parameters:
  • sbc (solvcon.boundcond.BC) - source BC object.
  • dbc (solvcon.boundcond.BC) - destination BC object.
  • ref (numpy.ndarray) - a reference point for matching bounding faces.
  • reciprocal (Glue) - the glue object on the other side.
Overrides: object.__init__

__sortfcs(bc, ref)
Static Method

source code 

Get the sorted face list of a BC object according to the reference point.

Parameters:
  • bc (solvcon.boundcond.BC) - a BC object.
  • ref (numpy.ndarray) - reference point.
Returns: numpy.ndarray
sorted face indices shifted by ngstface.

enable(self, *args, **kw)

source code 

Enable this glue by setting ghost information from interior and store original values in a cache. Arguments are the keys of arrays to be cached.

Parameters:
  • with_default (bool) - use CACHE_KEYS_ENABLER anyway. Default True.
Returns:
nothing

disable(self, *args, **kw)

source code 

Disable this glue by restoring ghost information from cached values. Arguments are the keys of cached arrays.

Parameters:
  • with_default (bool) - use CACHE_KEYS_ENABLER anyway. Default True.
Returns:
nothing

take(self, key)

source code 

Take array values from interior cells to ghost cells.

Parameters:
  • key (str) - the name of the array.
Returns:
nothing