Package hedge :: Module discretization :: Class Discretization
[hide private]
[frames] | no frames]

Class Discretization

source code


The global approximation space.

Instances of this class tie together a local discretization (i.e. polynomials on an elemnent) into a function space on a mesh. They provide creation functions such as interpolating given functions, differential operators and flux lifting operators.

Instance Methods [hide private]
 
__init__(self, mesh, local_discretization=None, order=None, debug=set([]), default_scalar_type=<type 'numpy.float64'>, run_context=None)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
close(self) source code
 
create_op_timers(self) source code
 
add_instrumentation(self, mgr) source code
 
_build_element_groups_and_nodes(self, local_discretization) source code
 
_calculate_local_matrices(self) source code
 
_set_flux_face_data(self, f, ldis, (el, fi)) source code
 
_build_interior_face_groups(self) source code
 
boundary_nonempty(self, tag) source code
 
get_boundary(self, tag)
Get a _Boundary instance for a given `tag'.
source code
 
__len__(self)
Return the number of nodes in this discretization.
source code
 
len_boundary(self, tag) source code
 
get_kind(self, field) source code
 
convert_dtype(self, field, dtype) source code
 
convert_volume(self, field, kind) source code
 
convert_boundary(self, field, tag, kind) source code
 
convert_boundary_async(self, field, tag, kind, read_map=None) source code
 
volume_empty(self, shape=(), dtype=None, kind='numpy') source code
 
volume_zeros(self, shape=(), dtype=None, kind='numpy') source code
 
interpolate_volume_function(self, f, dtype=None, kind=None) source code
 
boundary_empty(self, tag, shape=(), dtype=None, kind='numpy') source code
 
boundary_zeros(self, tag, shape=(), dtype=None, kind='numpy') source code
 
interpolate_boundary_function(self, f, tag, dtype=None, kind=None) source code
 
boundary_normals(self, tag, dtype=None, kind=None) source code
 
volumize_boundary_field(self, bfield, tag, kind=None) source code
 
boundarize_volume_field(self, field, tag, kind=None) source code
 
boundarize_volume_field_async(self, field, tag, kind=None) source code
 
prepare_from_neighbor_map(self, indices) source code
 
nodewise_dot_product(self, a, b) source code
 
_mass_ones(self) source code
 
mesh_volume(self) source code
 
integral(self, volume_vector) source code
 
_compiled_mass_operator(self) source code
 
norm(self, volume_vector, p=2) source code
 
inner_product(self, a, b) source code
 
find_el_range(self, el_id) source code
 
find_el_discretization(self, el_id) source code
 
find_el_data(self, el_id) source code
 
find_element(self, idx) source code
 
dt_non_geometric_factor(self) source code
 
dt_geometric_factor(self) source code
 
dt_factor(self, max_system_ev, stepper_class=None, *stepper_args)
Calculate the largest stable timestep, given a time stepper `stepper_class`.
source code
 
get_point_evaluator(self, point) source code
 
compile(self, optemplate, post_bind_mapper=<function <lambda> at 0x94b925c>) source code
 
add_function(self, name, func) source code

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

Class Methods [hide private]
 
all_debug_flags(cls) source code
 
noninteractive_debug_flags(cls) source code
Static Methods [hide private]
 
get_local_discretization(mesh, local_discretization=None, order=None) source code
Class Variables [hide private]
  compute_kind = 'numpy'
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, mesh, local_discretization=None, order=None, debug=set([]), default_scalar_type=<type 'numpy.float64'>, run_context=None)
(Constructor)

source code 

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

Parameters:
  • debug - A set of strings indicating which debug checks should be activated. See validity check below for the currently defined set of debug flags.
Overrides: object.__init__

get_boundary(self, tag)

source code 

Get a _Boundary instance for a given `tag'.

If there is no boundary tagged with `tag', an empty _Boundary instance is returned. Asking for a nonexistant boundary is not an error. (Otherwise get_boundary would unnecessarily become non-local when run in parallel.)

Decorators:
  • @memoize_method

boundary_normals(self, tag, dtype=None, kind=None)

source code 
Decorators:
  • @memoize_method

_mass_ones(self)

source code 
Decorators:
  • @memoize_method

mesh_volume(self)

source code 
Decorators:
  • @memoize_method

_compiled_mass_operator(self)

source code 
Decorators:
  • @memoize_method

dt_factor(self, max_system_ev, stepper_class=None, *stepper_args)

source code 

Calculate the largest stable timestep, given a time stepper `stepper_class`. If none is given, RK4 is assumed.