From 651239c96e3e75d6141428c1f055a4ad1cad99ff Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Tue, 10 Dec 2024 21:11:47 +0000 Subject: [PATCH 1/3] Fix bug in London equations where curlcurl term is added to stiffness rather than mass term --- palace/models/spaceoperator.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/palace/models/spaceoperator.cpp b/palace/models/spaceoperator.cpp index b15c5c70d..ed46aeeae 100644 --- a/palace/models/spaceoperator.cpp +++ b/palace/models/spaceoperator.cpp @@ -821,7 +821,7 @@ void SpaceOperator::AddStiffnessCoefficients(double coeff, MaterialPropertyCoeff // Contribution for London superconductors. if (mat_op.HasLondonDepth()) { - df.AddCoefficient(mat_op.GetAttributeToMaterial(), mat_op.GetInvLondonDepth(), coeff); + f.AddCoefficient(mat_op.GetAttributeToMaterial(), mat_op.GetInvLondonDepth(), coeff); } } From 63a5c073b02f578234d1d4821e92d9a87eee34cb Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Tue, 10 Dec 2024 16:48:30 -0500 Subject: [PATCH 2/3] Disable div free if using London equations, there is no nullspace. Update documentation. --- docs/src/config/solver.md | 8 ++++++-- palace/drivers/eigensolver.cpp | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/docs/src/config/solver.md b/docs/src/config/solver.md index 4120c4043..e67793829 100644 --- a/docs/src/config/solver.md +++ b/docs/src/config/solver.md @@ -428,10 +428,14 @@ iterative solver choices, and the default choice depends on the iterative solver - `"Default"` `"DivFreeTol" [1.0e-12]` : Relative tolerance for divergence-free cleaning used in the -eigenmode simulation type. +eigenmode simulation type. Ignored if non-zero +[`config["Domains"]["Materials"]["LondonDepth"]`](domains.md##domains%5B%22Materials%22%5D%5B%22LondonDepth%22%5D) +is detected. `"DivFreeMaxIts" [1000]` : Maximum number of iterations for divergence-free cleaning use in -the eigenmode simulation type. +the eigenmode simulation type. Ignored if non-zero +[`config["Domains"]["Materials"]["LondonDepth"]`](domains.md##domains%5B%22Materials%22%5D%5B%22LondonDepth%22%5D) +is detected. `"EstimatorTol" [1.0e-6]` : Relative tolerance for flux projection used in the error estimate calculation. diff --git a/palace/drivers/eigensolver.cpp b/palace/drivers/eigensolver.cpp index bc5445288..cda6efabd 100644 --- a/palace/drivers/eigensolver.cpp +++ b/palace/drivers/eigensolver.cpp @@ -154,7 +154,7 @@ EigenSolver::Solve(const std::vector> &mesh) const // Construct a divergence-free projector so the eigenvalue solve is performed in the space // orthogonal to the zero eigenvalues of the stiffness matrix. std::unique_ptr> divfree; - if (iodata.solver.linear.divfree_max_it > 0) + if (iodata.solver.linear.divfree_max_it > 0 && !space_op.GetMaterialOp().HasLondonDepth()) { Mpi::Print(" Configuring divergence-free projection\n"); constexpr int divfree_verbose = 0; From e67c73b54827b5aeb33afb47dfe4d51e65f1fae5 Mon Sep 17 00:00:00 2001 From: Hugh Carson Date: Tue, 10 Dec 2024 17:01:46 -0500 Subject: [PATCH 3/3] Update CHANGELOG --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 104794915..360755938 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,8 @@ The format of this changelog is based on - Added adaptive time-stepping capability for transient simulations. The new ODE integrators rely on the SUNDIALS library and can be specified by setting the `config["Solver"]["Transient"]["Type"]` option to `"CVODE"` or `"ARKODE"`. + - Fix bug in London equation implementation where a curl-curl term was added to the + stiffness operator instead of a mass term. ## [0.13.0] - 2024-05-20