From 884428360725c427a80c5384fc9e0b1e2b506596 Mon Sep 17 00:00:00 2001 From: Jake Harmon Date: Fri, 10 Mar 2023 20:25:02 -0700 Subject: [PATCH] Improved default params; Readme edit --- Maxwell-Eigenvalue-hp-Refinement/Readme.md | 4 ++-- Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc | 18 +++++++++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/Maxwell-Eigenvalue-hp-Refinement/Readme.md b/Maxwell-Eigenvalue-hp-Refinement/Readme.md index fc16d4d..aba0ad7 100644 --- a/Maxwell-Eigenvalue-hp-Refinement/Readme.md +++ b/Maxwell-Eigenvalue-hp-Refinement/Readme.md @@ -25,10 +25,10 @@ $$ e_{\lambda_{hp}} := \lambda-\lambda_{hp}. $$ Some comments on the discretization of Maxwell's equations ---------------------------------------------------------- In the proper solution of variational problem, $V_{hp}$ is not arbitrary, but should instead a subspace of $H(\mathrm{curl};\,\Omega)$ or, with the boundary conditions indicated above, $H_{0}(\mathrm{curl};\,\Omega)$, where -$$ H(\mathrm{curl};\,\Omega) = \left\{\textbf{u}\in \left[ L_2(\Omega)\right]^d \, \mathrm{s.t.} \, \nabla\times\textbf{u}\in \left[ L_2(\Omega)\right]^{d} \right\}$$ +$$ H(\mathrm{curl};\,\Omega) = \left\{\textbf{u}\in \left[ L_2(\Omega)\right]^d \, \mathrm{s.t.} \, \nabla\times\textbf{u}\in \left[ L_2(\Omega)\right]^{2d-3} \right\}$$ and $$ -H_{0}(\mathrm{curl};\,\Omega) = \left\{ \textbf{u}\in H(\mathrm{curl};\,\Omega) \, \mathrm{s.t.} \, \hat{\textbf{n}}\times\textbf{u} = 0 \text{on $\partial\Omega$}\right\}. +H_{0}(\mathrm{curl};\,\Omega) = \left\{ \textbf{u}\in H(\mathrm{curl};\,\Omega) \, \mathrm{s.t.} \, \hat{\textbf{n}}\times\textbf{u} = 0 \text{ on $\partial\Omega$}\right\}. $$ The convergence of the discrete problem (e.g., as $h\rightarrow 0$) to the continuous one may be proved via a discrete compactness property [3]. It is also possible for other choices of finite element spaces to *converge*, just not necessarily to the *correct* solution, which was the case for discretizations (which typically treated the components of $\textbf{u}$ as belonging to $H^1$) of the Maxwell PDE prior to the work of Nédélec. diff --git a/Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc b/Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc index 338f39b..1bfe31c 100644 --- a/Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc +++ b/Maxwell-Eigenvalue-hp-Refinement/maxwell-hp.cc @@ -2212,19 +2212,27 @@ main(int argc, char **argv) Utilities::MPI::MPI_InitFinalize mpi_initialization(argc, argv, 1); - AssertThrow(Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, - ExcMessage( - "This program can only be run in serial, use ./maxwell-hp")); + AssertThrow( + Utilities::MPI::n_mpi_processes(MPI_COMM_WORLD) == 1, + ExcMessage("This program can only be run in serial, use ./maxwell-hp")); Triangulation<2> triangulation_DWR, triangulation_Kelly; Structures::create_L_waveguide(triangulation_DWR, 2.0); Structures::create_L_waveguide(triangulation_Kelly, 2.0); Refiner<2, KellyErrorIndicator<2>, LegendreIndicator<2>> problem_Kelly( - "maxwell-hp.prm", triangulation_Kelly, 2, 12, 2); + "maxwell-hp.prm", + triangulation_Kelly, + /*Minimum Degree*/ 2, + /*Maximum Degree*/ 5, + /*Starting Degree*/ 2); Refiner<2, DualWeightedResidual<2, false>, LegendreIndicator<2>> - problem_DWR("maxwell-hp.prm", triangulation_DWR, 2, 12, 2); + problem_DWR("maxwell-hp.prm", + triangulation_DWR, + /*Minimum Degree*/ 2, + /*Maximum Degree*/ 5, + /*Starting Degree*/ 2); // The threshold for the hp-decision: too small -> not enough // $h$-refinement, too large -> not enough $p$-refinement -- 2.39.5