Exemplo n.º 1
0
# output directory :
i = int(sys.argv[1])
dir_b   = './results_shelves/0'

# make the directory if needed :
out_dir = dir_b + str(i) + '/'
d       = os.path.dirname(out_dir)
if not os.path.exists(d):
  os.makedirs(d)


thklim = 200.0

measures  = DataFactory.get_ant_measures(res=900)
bedmap1   = DataFactory.get_bedmap1(thklim=thklim)
bedmap2   = DataFactory.get_bedmap2(thklim=thklim)

mesh      = Mesh('meshes/mesh_low.xml')
flat_mesh = Mesh('meshes/mesh_low.xml')
#mesh.coordinates()[:,2]      /= 100000.0
#flat_mesh.coordinates()[:,2] /= 100000.0


dm  = DataInput(None, measures, mesh=mesh)
db1 = DataInput(None, bedmap1,  mesh=mesh)
db2 = DataInput(None, bedmap2,  mesh=mesh)

db2.set_data_val('H', 32767, thklim)
db2.set_data_val('h', 32767, 0.0)
dm.set_data_min('v_mag', 0.0, 0.0)
Exemplo n.º 2
0
import sys
src_directory = '../../../'
sys.path.append(src_directory)

from src.utilities import DataInput, DataOutput
from data.data_factory import DataFactory
from meshes.mesh_factory import MeshFactory
from src.physics import VelocityBalance_2
from dolfin import Mesh, set_log_active

set_log_active(True)

thklim = 50.0

bedmap1 = DataFactory.get_bedmap1(thklim=thklim)
bedmap2 = DataFactory.get_bedmap2(thklim=thklim)

# load a mesh :
mesh = Mesh("meshes/2dmesh.xml")

db1 = DataInput(None, bedmap1, mesh=mesh)
db2 = DataInput(None, bedmap2, mesh=mesh)

h = db2.get_projection("h_n")
H = db2.get_projection("H_n")
adot = db1.get_projection("adot")

prb = VelocityBalance_2(mesh, H, h, adot, 12.0)
prb.solve_forward()

# File ouput
Exemplo n.º 3
0
import sys
import os
src_directory = '../../../'
sys.path.append(src_directory)

from pylab                  import *
from dolfin                 import *
from src.utilities          import DataInput, DataOutput
from src.physics            import VelocityBalance_2
from plot.plothelp.plotting import plotIce
from data.data_factory      import DataFactory
from meshes.mesh_factory    import MeshFactory

set_log_level(PROGRESS)

bm1 = DataFactory.get_bedmap1()
bm2 = DataFactory.get_bedmap2()

direc = os.path.dirname(os.path.realpath(__file__)) 

mesh   = Mesh("../meshes/mesh.xml")

# Import data :
d1     = DataInput(None, bm1, mesh=mesh)
d3     = DataInput(None, bm2, mesh=mesh, flip=True)

# set minimum values for data :
d3.set_data_val("H",    32767, 10.0)
d3.set_data_val("h",    32767,  0.0)
d3.set_data_val("mask", 127,    1.0)