def __init__(self, problem): # Store problem self.problem = problem # Store initial and current mesh self.Omega_F = problem.fluid_mesh() self.omega_F0 = Mesh(self.Omega_F) self.omega_F1 = Mesh(self.Omega_F) # Create functions for velocity and pressure on reference domain self.V = VectorFunctionSpace(self.Omega_F, "CG", 2) self.Q = FunctionSpace(self.Omega_F, "CG", 1) self.U_F0 = Function(self.V) self.U_F1 = Function(self.V) self.P_F0 = Function(self.Q) self.P_F1 = Function(self.Q) self.U_F = 0.5 * (self.U_F0 + self.U_F1) self.P_F = 0.5 * (self.P_F0 + self.P_F1) # Create mesh function on Omega_F1 for fluid-structure boundary. # This is necessary since the original mesh function is otherwise # defined on Omega_F0 which leads to an error when setting bcs. self.fsi_boundary_F1 = FacetFunction("uint", self.omega_F1) self.fsi_boundary_F1.array()[:] = self.problem.fsi_boundary_F.array() # Calculate number of dofs self.num_dofs = self.V.dim() + self.Q.dim() # Initialize base class NavierStokes.__init__(self) # Don't plot and save solution in subsolvers self.parameters["solver_parameters"]["plot_solution"] = False self.parameters["solver_parameters"]["save_solution"] = False
def __init__(self, problem, parameters): # Store problem self.problem = problem # Store initial and current mesh self.Omega = problem.mesh() # Initialize base class NavierStokes.__init__(self) # Handle plotting and saving self.parameters["solver_parameters"]["plot_solution"] = parameters["plot_solution"] self.parameters["solver_parameters"]["save_solution"] = False
def __init__(self, problem, parameters): # Store problem self.problem = problem # Store initial and current mesh self.Omega = problem.mesh() # Initialize base class NavierStokes.__init__(self) # Handle plotting and saving self.parameters["solver_parameters"]["plot_solution"] = parameters[ "plot_solution"] self.parameters["solver_parameters"]["save_solution"] = False