コード例 #1
0
    def __init__(self,
                 domain,
                 quantity,
                 value=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 description=None,
                 label=None,
                 logging=False,
                 verbose=False,
                 test_stage=True,
                 test_elevation=True):

        Set_quantity.__init__(self,
                              domain,
                              quantity,
                              value,
                              indices=indices,
                              polygon=polygon,
                              center=center,
                              radius=radius,
                              line=line,
                              test_stage=test_stage,
                              test_elevation=test_elevation)

        Operator.__init__(self, domain, description, label, logging, verbose)
コード例 #2
0
    def __init__(self,
                 domain,
                 elevation=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 verbose=False):

        Set_quantity.__init__(self,
                              domain,
                              'elevation',
                              value=elevation,
                              indices=indices,
                              polygon=polygon,
                              center=center,
                              radius=radius,
                              line=line,
                              verbose=verbose,
                              test_elevation=False)

        #-----------------------------------------
        # Extra structures to support maintaining
        # continuity of elevation
        #-----------------------------------------
        self.setup_node_structures()

        #------------------------------------------
        # Extra aliases for changing elevation
        # to ensure conservation of mass and
        # continuity at vertices and edges
        #------------------------------------------
        self.elev_v = self.domain.quantities['elevation'].vertex_values
        self.elev_e = self.domain.quantities['elevation'].edge_values
        self.stage_c = self.domain.quantities['stage'].centroid_values
        self.elev_c = self.domain.quantities['elevation'].centroid_values

        #------------------------------------------
        # x,y coordinates of vertices of cells that are
        # updated
        #------------------------------------------
        coord_v = self.domain.vertex_coordinates
        ids = self.indices
        if ids is None:
            self.v_x = coord_v[:, 0].reshape((-1, 3))
            self.v_y = coord_v[:, 1].reshape((-1, 3))
        else:
            self.v_x = coord_v[:, 0].reshape((-1, 3))[ids]
            self.v_y = coord_v[:, 1].reshape((-1, 3))[ids]

        #print self.v_x.shape
        #print self.v_y.shape

        #------------------------------------------
        # Need to turn off this optimization as it
        # doesn't fixup the relationship between
        # bed and stage vertex values in dry region
        #------------------------------------------
        self.domain.optimise_dry_cells = 0
コード例 #3
0
    def __init__(self,
                 domain,
                 quantity,
                 value=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 description = None,
                 label = None,
                 logging = False,
                 verbose = False,
                 test_stage=True,
                 test_elevation=True):


 

        Set_quantity.__init__(self, 
                              domain, 
                              quantity, 
                              value, 
                              indices=indices, 
                              polygon=polygon, 
                              center=center, 
                              radius=radius, 
                              line=line,
                              test_stage=test_stage,
                              test_elevation=test_elevation)

        Operator.__init__(self, domain, description, label, logging, verbose)
コード例 #4
0
ファイル: set_stage.py プロジェクト: chrimerss/anuga_core
    def __init__(self,
                 domain,
                 stage=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 verbose=False):

        Set_quantity.__init__(self,
                              domain,
                              'stage',
                              value=stage,
                              indices=indices,
                              polygon=polygon,
                              center=center,
                              radius=radius,
                              line=line,
                              verbose=verbose,
                              test_stage=False)

        #------------------------------------------
        # Extra aliases for changing stage
        #------------------------------------------
        self.stage_c = self.domain.quantities['stage'].centroid_values
        self.elev_c = self.domain.quantities['elevation'].centroid_values
        self.height_c = self.domain.quantities['height'].centroid_values

        #------------------------------------------
        # x,y coordinates of vertices of cells that are
        # updated
        #------------------------------------------
        coord_v = self.domain.vertex_coordinates
        ids = self.indices
        if ids is None:
            self.v_x = coord_v[:, 0].reshape((-1, 3))
            self.v_y = coord_v[:, 1].reshape((-1, 3))
        else:
            self.v_x = coord_v[:, 0].reshape((-1, 3))[ids]
            self.v_y = coord_v[:, 1].reshape((-1, 3))[ids]

        #------------------------------------------
        # Need to turn off this optimization as it
        # doesn't fixup the relationship between
        # bed and stage vertex values in dry region
        #------------------------------------------
        self.domain.optimise_dry_cells = 0
コード例 #5
0
    def __init__(self,
                 domain,
                 stage=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 verbose = False):

        Set_quantity.__init__(self, domain, 'stage',
                              value=stage,
                              indices=indices,
                              polygon=polygon,
                              center=center,
                              radius=radius,
                              line=line,
                              verbose=verbose,
                              test_stage=False)

        #------------------------------------------
        # Extra aliases for changing stage
        #------------------------------------------
        self.stage_c = self.domain.quantities['stage'].centroid_values
        self.elev_c = self.domain.quantities['elevation'].centroid_values
        self.height_c = self.domain.quantities['height'].centroid_values

        #------------------------------------------
        # x,y coordinates of vertices of cells that are
        # updated
        #------------------------------------------
        coord_v = self.domain.vertex_coordinates
        ids = self.indices
        if ids is None:
            self.v_x = coord_v[:,0].reshape((-1,3))
            self.v_y = coord_v[:,1].reshape((-1,3))
        else:
            self.v_x = coord_v[:,0].reshape((-1,3))[ids]
            self.v_y = coord_v[:,1].reshape((-1,3))[ids]

        #------------------------------------------
        # Need to turn off this optimization as it
        # doesn't fixup the relationship between
        # bed and stage vertex values in dry region
        #------------------------------------------
        self.domain.optimise_dry_cells = 0
コード例 #6
0
    def __init__(self,
                 domain,
                 elevation=None,
                 indices=None,
                 polygon=None,
                 center=None,
                 radius=None,
                 line=None,
                 verbose = False):

        Set_quantity.__init__(self, domain, 'elevation',
                              value=elevation,
                              indices=indices,
                              polygon=polygon,
                              center=center,
                              radius=radius,
                              line=line,
                              verbose=verbose,
                              test_elevation=False)



        #-----------------------------------------
        # Extra structures to support maintaining
        # continuity of elevation
        #-----------------------------------------
        self.setup_node_structures()


        #------------------------------------------
        # Extra aliases for changing elevation
        # to ensure conservation of mass and
        # continuity at vertices and edges
        #------------------------------------------
        self.elev_v  = self.domain.quantities['elevation'].vertex_values
        self.elev_e = self.domain.quantities['elevation'].edge_values
        self.stage_c = self.domain.quantities['stage'].centroid_values
        self.elev_c = self.domain.quantities['elevation'].centroid_values

        #------------------------------------------
        # x,y coordinates of vertices of cells that are
        # updated
        #------------------------------------------
        coord_v = self.domain.vertex_coordinates
        ids = self.indices
        if ids is None:
            self.v_x = coord_v[:,0].reshape((-1,3))
            self.v_y = coord_v[:,1].reshape((-1,3))
        else:
            self.v_x = coord_v[:,0].reshape((-1,3))[ids]
            self.v_y = coord_v[:,1].reshape((-1,3))[ids]

        #print self.v_x.shape
        #print self.v_y.shape

        #------------------------------------------
        # Need to turn off this optimization as it
        # doesn't fixup the relationship between
        # bed and stage vertex values in dry region
        #------------------------------------------
        self.domain.optimise_dry_cells = 0