Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions FSI/cylinderFlap/OpenFOAM-FEniCS/Solid/cyl-flap.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def remaining_boundary(x, on_boundary):
force_boundary = AutoSubDomain(remaining_boundary)

# Initialize the coupling interface
precice_dt = precice.initialize(coupling_boundary, mesh, V, dim)
precice_dt = precice.initialize(coupling_boundary, mesh, V, dim, fixed_boundary=clamped_boundary_domain)

fenics_dt = precice_dt # if fenics_dt == precice_dt, no subcycling is applied
# fenics_dt = 0.02 # if fenics_dt < precice_dt, subcycling is applied
Expand Down Expand Up @@ -171,8 +171,6 @@ def avg(x_old, x_new, alpha):

res = m(avg(a_n, a_np1, alpha_m), v) + k(avg(u_n, du, alpha_f), v)

Forces_x, Forces_y = precice.create_point_sources(clamped_boundary_domain)

a_form = lhs(res)
L_form = rhs(res)

Expand Down Expand Up @@ -201,7 +199,7 @@ def avg(x_old, x_new, alpha):
read_data = precice.read_data()

# Update the point sources on the coupling boundary with the new read data
Forces_x, Forces_y = precice.update_point_sources(read_data)
Forces_x, Forces_y = precice.get_point_sources(read_data)

A, b = assemble_system(a_form, L_form, bc)

Expand Down
6 changes: 2 additions & 4 deletions FSI/flap_perp/OpenFOAM-FEniCS/Solid/perp-flap.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def neumann_boundary(x, on_boundary):
force_boundary = AutoSubDomain(neumann_boundary)

# Initialize the coupling interface
precice_dt = precice.initialize(coupling_boundary, mesh, V, dim)
precice_dt = precice.initialize(coupling_boundary, mesh, V, dim, fixed_boundary=clamped_boundary_domain)

fenics_dt = precice_dt # if fenics_dt == precice_dt, no subcycling is applied
# fenics_dt = 0.02 # if fenics_dt < precice_dt, subcycling is applied
Expand Down Expand Up @@ -165,8 +165,6 @@ def avg(x_old, x_new, alpha):

res = m(avg(a_n, a_np1, alpha_m), v) + k(avg(u_n, du, alpha_f), v)

Forces_x, Forces_y = precice.create_point_sources(clamped_boundary_domain)

a_form = lhs(res)
L_form = rhs(res)

Expand Down Expand Up @@ -194,7 +192,7 @@ def avg(x_old, x_new, alpha):
read_data = precice.read_data()

# Update the point sources on the coupling boundary with the new read data
Forces_x, Forces_y = precice.update_point_sources(read_data)
Forces_x, Forces_y = precice.get_point_sources(read_data)

A, b = assemble_system(a_form, L_form, bc)

Expand Down
9 changes: 3 additions & 6 deletions HT/partitioned-heat/fenics-fenics/heat.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,13 @@ def determine_gradient(V_g, u, flux):
# Initialize the adapter according to the specific participant
if problem is ProblemType.DIRICHLET:
precice = Adapter(adapter_config_filename="precice-adapter-config-D.json")
precice_dt = precice.initialize(coupling_boundary, mesh, V)
initial_data = precice.initialize_data(f_N_function)
precice_dt = precice.initialize(coupling_boundary, mesh, V, write_function=f_N_function)
elif problem is ProblemType.NEUMANN:
precice = Adapter(adapter_config_filename="precice-adapter-config-N.json")
precice_dt = precice.initialize(coupling_boundary, mesh, V_g)
initial_data = precice.initialize_data(u_D_function)
precice_dt = precice.initialize(coupling_boundary, mesh, V_g, write_function=u_D_function)

boundary_marker = False

coupling_expression = precice.create_coupling_expression(initial_data)

dt = Constant(0)
dt.assign(np.min([fenics_dt, precice_dt]))

Expand All @@ -148,6 +144,7 @@ def determine_gradient(V_g, u, flux):
bcs = [DirichletBC(V, u_D, remaining_boundary)]

# Set boundary conditions at coupling interface once wrt to the coupling expression
coupling_expression = precice.create_coupling_expression()
if problem is ProblemType.DIRICHLET:
# modify Dirichlet boundary condition on coupling interface
bcs.append(DirichletBC(V, coupling_expression, coupling_boundary))
Expand Down