Ejemplo n.º 1
0
(lam, master_mwes_and_fields_by_name) = jT_lam(
    mesh=my_mesh,
    sigma_el=su.of(sigma),  # electrical conductivity
    sigma_th=su.of(k),  # thermal conductivity
    c_heat=su.of(c_heat),  # heat capacity
    T_initial=su.of(T_initial),
)

(mwe_T, field_T) = master_mwes_and_fields_by_name['T']

sundialsbuffer_initial = ocaml.raw_make_field(mwe_T, [], "",
                                              "sundials_initial")
sundialsbuffer_final = ocaml.raw_make_field(mwe_T, [], "", "sundials_final")
sundialsbuffer_starting = ocaml.raw_make_field(mwe_T, [], "", "sundials_work")

ocaml.field_copy_into(field_T, sundialsbuffer_initial)
ocaml.field_copy_into(field_T, sundialsbuffer_starting)

(cvode,fun_timings)=ocaml.raw_make_linalg_machine_cvode(\
              lam, sundialsbuffer_starting,
              "jacobian","execute_jplan",
              "rhs",
              jacobi_same_nonzero_pattern,
              max_order,
              krylov_max,
              )

heatingTime = SI(2e-9, 's')
coolingTime = 0 * SI(10e-9, 's')
timeStep = SI(0.025e-9, 's')
timeStep = SI(0.1e-9, 's')
Ejemplo n.º 2
0
def field_copy_into(s, d):
    return ocaml.field_copy_into(s, d)
Ejemplo n.º 3
0
my_mesh=nmesh.load(mesh_filename)
(lam,master_mwes_and_fields_by_name) = jT_lam(mesh=my_mesh,
                                              sigma_el=su.of(sigma), # electrical conductivity
                                              sigma_th=su.of(k), # thermal conductivity
                                              c_heat=su.of(c_heat),# heat capacity
                                              T_initial=su.of(T_initial),
)

(mwe_T,field_T) = master_mwes_and_fields_by_name['T']

sundialsbuffer_initial = ocaml.raw_make_field(mwe_T,[],"","sundials_initial")
sundialsbuffer_final = ocaml.raw_make_field(mwe_T,[],"","sundials_final")
sundialsbuffer_starting = ocaml.raw_make_field(mwe_T,[],"","sundials_work")

ocaml.field_copy_into(field_T, sundialsbuffer_initial)
ocaml.field_copy_into(field_T, sundialsbuffer_starting)

(cvode,fun_timings)=ocaml.raw_make_linalg_machine_cvode(\
              lam, sundialsbuffer_starting,
              "jacobian","execute_jplan",
              "rhs",
              jacobi_same_nonzero_pattern,
              max_order,
              krylov_max,
              )

heatingTime = SI(2e-9,'s')
coolingTime = SI(2e-9,'s')
timeStep=SI(0.025e-9,'s')
Ejemplo n.º 4
0
def field_copy_into(s, d):
    return ocaml.field_copy_into(s, d)