source: trunk/anuga_work/development/gareth/balanced_basic/swb2_boundary_conditions.py @ 8302

Last change on this file since 8302 was 8302, checked in by davies, 12 years ago

Adding files for swb2

File size: 1000 bytes
Line 
1
2from anuga.abstract_2d_finite_volumes.generic_boundary_conditions\
3     import Boundary
4
5class Transmissive_boundary(Boundary):
6    """Transmissive boundary returns same conserved quantities as
7    those present in its neighbour volume.
8
9    Underlying domain must be specified when boundary is instantiated
10    """
11
12    def __init__(self, domain = None):
13        Boundary.__init__(self)
14
15        if domain is None:
16            msg = 'Domain must be specified for transmissive boundary'
17            raise Exception, msg
18
19        self.domain = domain
20
21    def __repr__(self):
22        return 'Transmissive_boundary(%s)' %self.domain
23
24    def evaluate(self, vol_id, edge_id):
25        """Transmissive boundaries return the edge values
26        of the volume they serve.
27        """
28
29        if self.domain.get_centroid_transmissive_bc() :
30            q = self.domain.get_evolved_quantities(vol_id)
31        else:
32            q = self.domain.get_evolved_quantities(vol_id, edge = edge_id)
33        return q
Note: See TracBrowser for help on using the repository browser.