示例#1
0
import varglas.model              as model
from varglas.data.data_factory    import DataFactory
from varglas.mesh.mesh_factory    import MeshFactory
from varglas.io                   import DataInput, DataOutput
from varglas.helper               import default_config
from fenics                       import *
from scipy.io                     import loadmat

# get the input args :
out_dir = 'dump/bed/09/bv_smb/'
in_dir  = 'dump/bed/09/'

mesh   = Mesh(in_dir + 'submesh.xdmf')
Q      = FunctionSpace(mesh, 'CG', 1)

bamber = DataFactory.get_bamber()
dbm    = DataInput(bamber,  mesh=mesh)

S      = Function(Q)
B      = Function(Q)

File(in_dir + 'S_s.xml') >> S
File(in_dir + 'B_s.xml') >> B

adot_v = loadmat(in_dir + 'smb/smb.mat')
dbm.data['smb'] = adot_v['map_data']

adot = dbm.get_expression('smb', near=True)

config = default_config()
config['output_path']               = out_dir
示例#2
0
import varglas.physical_constants as pc
import varglas.model              as model
from varglas.mesh.mesh_factory    import MeshFactory
from varglas.data.data_factory    import DataFactory
from varglas.io                   import DataInput
from fenics                       import *

out_dir  = 'dump/vars_ant_spacing/'
thklim   = 1.0

# collect the raw data :
searise  = DataFactory.get_searise(thklim = thklim)
bamber   = DataFactory.get_bamber(thklim = thklim)
fm_qgeo  = DataFactory.get_gre_qgeo_fox_maule()
rignot   = DataFactory.get_gre_rignot()

# define the mesh :
mesh = Mesh('dump/meshes/gre_mesh_ant_spacing.xml')

# create data objects to use with varglas :
dsr     = DataInput(searise,  mesh=mesh)
dbm     = DataInput(bamber,   mesh=mesh)
dfm     = DataInput(fm_qgeo,  mesh=mesh)
drg     = DataInput(rignot,   mesh=mesh)
    
# change the projection of all data to Rignot projection :
dsr.change_projection(drg)
dbm.change_projection(drg)
dfm.change_projection(drg)

# get the expressions used by varglas :