Ejemplo n.º 1
0
    else:
        return 0


def laplace_dbc_value(dof_name_indices, coords):
    if (coords[1] > 0.0):
        return 0.5
    else:
        return -0.5


# We need an empty source field for the laplace solver:

cofield_drho_by_dt = ocaml.raw_make_cofield(
    mwe_drho_by_dt,
    [],  # do not sample a function
    ""  # petsc name - auto-generated if "".
)

prematrix_laplace = ocaml.raw_make_prematrix(
    diffop_laplace,
    mwe_drho_by_dt,
    mwe_phi,
    [mwe_sigma],  # opt. middle field
    True,
    # ^ ignore_jumps:
    # don't do the calculations
    # for surface divergency-like matrix element contributions.
    # We do not need them here.
)
Ejemplo n.º 2
0
        return 1
    else:
        return 0


def laplace_dbc_value(dof_name_indices, coords):
    if coords[1] > 0.0:
        return 0.5
    else:
        return -0.5


# We need an empty source field for the laplace solver:

cofield_drho_by_dt = ocaml.raw_make_cofield(
    mwe_drho_by_dt, [], ""  # do not sample a function  # petsc name - auto-generated if "".
)

prematrix_laplace = ocaml.raw_make_prematrix(
    diffop_laplace,
    mwe_drho_by_dt,
    mwe_phi,
    [mwe_sigma],  # opt. middle field
    True,
    # ^ ignore_jumps:
    # don't do the calculations
    # for surface divergency-like matrix element contributions.
    # We do not need them here.
)

Ejemplo n.º 3
0
def make_cofield(mwe, initial_values=None, petsc_name="", restriction=""):
    log.log(15, "About to create cofield from mwe XXX")
    iv = []
    if initial_values:
        iv = [initial_values]
    return ocaml.raw_make_cofield(mwe, iv, restriction, petsc_name)
Ejemplo n.º 4
0
def make_cofield(mwe, initial_values=None, petsc_name="", restriction=""):
    log.log(15, "About to create cofield from mwe XXX")
    iv = []
    if initial_values:
        iv = [initial_values]
    return ocaml.raw_make_cofield(mwe, iv, restriction, petsc_name)