Ignore:
Timestamp:
Sep 1, 2004, 5:56:05 AM (20 years ago)
Author:
ole
Message:

Optimised reflective boundary

Location:
inundation/ga/storm_surge/pyvolution
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pyvolution/domain.py

    r242 r263  
    493493            #Clean up
    494494            Q.semi_implicit_update[:] = 0.0
    495             Q.explicit_update[:] = 0.0 #Not necessary as fluxes will set it
     495            Q.explicit_update[:] = 0.0 #Unnecessary as fluxes will set it
    496496           
    497497
  • inundation/ga/storm_surge/pyvolution/shallow_water.py

    r260 r263  
    574574            raise msg
    575575       
    576         self.domain = domain
    577        
     576        #Handy shorthands
     577        self.level = domain.quantities['level'].edge_values
     578        self.xmom = domain.quantities['xmomentum'].edge_values
     579        self.ymom = domain.quantities['ymomentum'].edge_values         
     580        self.normals = domain.normals
     581       
     582        from Numeric import zeros, Float       
     583        self.conserved_quantities = zeros(3, Float)
    578584       
    579585    def __repr__(self):
     
    585591        of the volume they serve.
    586592        """
    587        
    588         q = self.domain.get_conserved_quantities(vol_id, edge = edge_id)
    589         normal = self.domain.get_normal(vol_id, edge_id)
     593
     594        q = self.conserved_quantities
     595        q[0] = self.level[vol_id, edge_id]
     596        q[1] = self.xmom[vol_id, edge_id]
     597        q[2] = self.ymom[vol_id, edge_id]
     598       
     599        normal = self.normals[vol_id, 2*edge_id:2*edge_id+2]     
     600
    590601       
    591602        r = rotate(q, normal, direction = 1)
     
    685696
    686697
     698    xmom = domain.quantities['xmomentum']
     699    ymom = domain.quantities['ymomentum']   
     700       
    687701    w = domain.quantities['level'].centroid_values
    688     uh = domain.quantities['xmomentum'].centroid_values
    689     vh = domain.quantities['ymomentum'].centroid_values
     702    uh = xmom.centroid_values
     703    vh = ymom.centroid_values
    690704    eta = domain.quantities['friction'].centroid_values   
    691705   
    692     xmom_update = domain.quantities['xmomentum'].semi_implicit_update
    693     ymom_update = domain.quantities['ymomentum'].semi_implicit_update   
     706    xmom_update = xmom.semi_implicit_update
     707    ymom_update = ymom.semi_implicit_update   
    694708   
    695709    N = domain.number_of_elements
Note: See TracChangeset for help on using the changeset viewer.