Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

# This file is part of the pyMOR project (http://www.pymor.org). 

# Copyright Holders: Rene Milk, Stephan Rave, Felix Schindler 

# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause) 

 

from __future__ import absolute_import, division, print_function 

 

from pymor.core import ImmutableInterface 

from pymor.domaindescriptions.boundarytypes import BoundaryType 

 

 

class DomainDescriptionInterface(ImmutableInterface): 

    '''Analytically describes a domain and its boundary (types). 

 

    Attributes 

    ---------- 

    boundary_types 

        Set of |BoundaryTypes| the domain has. 

    ''' 

 

    boundary_types = frozenset() 

 

    @property 

    def has_dirichlet(self): 

        return BoundaryType('dirichlet') in self.boundary_types 

 

    @property 

    def has_neumann(self): 

        return BoundaryType('neumann') in self.boundary_types 

 

    @property 

    def has_only_dirichlet(self): 

        return self.boundary_types == {BoundaryType('dirichlet')} 

 

    @property 

    def has_only_neumann(self): 

        return self.boundary_types == {BoundaryType('neumann')} 

 

    @property 

    def has_only_dirichletneumann(self): 

        return self.boundary_types <= {BoundaryType('dirichlet'), BoundaryType('neumann')}