def __init__(self, a, L):
     self.L, self.a = Form(L), Form(a)
예제 #2
0
 def __init__(self, a, L):
     super().__init__()
     self.L = Form(L)
     self.a = Form(a)
     self._F = None
     self._J = None
예제 #3
0
파일: beam.py 프로젝트: michalhabera/fecoda
def loading_bc(x):
    values = np.zeros((1, x.shape[1]))
    values[0] = -0.001
    return values


J, F, expr_compiled =\
    fecoda.main.compile_forms(intern_var0, intern_var1, w0, w1, f, g,
                              heat_flux, water_flux, co2_flux, t, dt,
                              [dx(1), dx(2)], [dx(10)], randomize=5.e-2)

DMG = FunctionSpace(mesh, ("DG", 0))
dmg0 = Function(DMG, name="dmg")

# Define variational problem for projection
proj_rhs = Form(ufl.inner(intern_var0["dmg"], ufl.TestFunction(DMG)) * dx)
mass_DMG = assemble_matrix(
    ufl.inner(ufl.TrialFunction(DMG), ufl.TestFunction(DMG)) * dx, [])
mass_DMG.assemble()

dscale = 1.0
apply_load = True

t0 = time()

# Global time loop
for k in range(len(dtimes)):

    t.value = times[k]
    dt.value = dtimes[k]