-
Notifications
You must be signed in to change notification settings - Fork 19
Description
Motivation
Another feature request motivated by wave propagation: to compute a band structure for periodic media, we prescribe the wavevector
Requested improvement
Make MultiPointConstraint.create_periodic_constraint_topological
(and create_periodic_constraint_geometrical
, etc.) return the mpc_data
object that is generated by the C++ layer. Then it can be saved and the mpc_data.coeffs
array updated at each iteration, e.g.
mpc = MultiPointConstraint(V)
mpc_data = mpc.create_periodic_constraint_topological( ... )
for k in np.linspace(0, 1, N):
mpc_data.coeffs[:] = k
mpc = MultiPointConstraint(V)
mpc.add_constraint_from_mpc_data(mpc_data)
mpc.finalize()
# Solve eigenvalue problem
Note: this is already possible by directly accessing the C++ wrapper layer, i.e. with
mpc_data = dolfinx_mpc.cpp.mpc.create_periodic_constraint_topological( ... )
but the suggested improvement would result in cleaner code and eliminate the need for users to directly call the C++ layer.