Skip to content

Commit

Permalink
#223: Update demos with GoalOrientedMeshSeq 2
Browse files Browse the repository at this point in the history
  • Loading branch information
ddundo committed Nov 12, 2024
1 parent fe7d21b commit 1069218
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions demos/burgers_oo.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ class BurgersMeshSeq(GoalOrientedMeshSeq):
def get_function_spaces(mesh):
return {"u": VectorFunctionSpace(mesh, "CG", 2)}

def get_form(self):
def form(index):
def get_solver(self):
def solver(index):
u, u_ = self.fields["u"]

# Define constants
Expand All @@ -46,16 +46,9 @@ def form(index):
+ inner(dot(u, nabla_grad(u)), v) * dx
+ nu * inner(grad(u), grad(v)) * dx
)
return {"u": F}

return form

def get_solver(self):
def solver(index):
u, u_ = self.fields["u"]

# Define form
F = self.form(index)["u"]
# Communicate variational form to mesh_seq
self.read_forms({"u": F})

# Time integrate from t_start to t_end
t_start, t_end = self.subintervals[index]
Expand Down

0 comments on commit 1069218

Please sign in to comment.