Skip to content

Commit c6fcae6

Browse files
Update docs, JSON Schema, changelog
1 parent 81190bc commit c6fcae6

File tree

10 files changed

+100
-67
lines changed

10 files changed

+100
-67
lines changed

CHANGELOG.md

+18-2
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,35 @@ The format of this changelog is based on
1111
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to
1212
[Semantic Versioning](https://semver.org/).
1313

14+
## In progress
15+
16+
- Changed implementation of complex-valued linear algebra to use new `ComplexVector` and
17+
`ComplexOperator` types, which are based on the underlying `mfem::Vector` and
18+
`mfem::Operator` classes, instead of PETSc. PETSc is now fully optional and only required
19+
when SLEPc eigenvalue solver support is requested. Krylov solvers for real- and complex-
20+
valued linear systems are implemented via the built-in `IterativeSolver` classes.
21+
- Changed implementation of PROMs for adaptive fast frequency sweep to use the Eigen
22+
library for sequential dense linear algebra.
23+
- Changed implementation of numeric wave ports to use MFEM's `SubMesh` functionality. As
24+
of [#3379](https://github.com/mfem/mfem/pull/3379) in MFEM, this has full ND and RT basis
25+
support. For now, support for nonconforming mesh boundaries is limited.
26+
- Added build dependencies on [libCEED](https://github.com/CEED/libCEED) and
27+
[LIBXSMM](https://github.com/libxsmm/libxsmm) to support operator partial assembly (CPU-
28+
based for now).
29+
1430
## [0.11.2] - 2023-07-14
1531

16-
- Changed layout and names of `palace/` source directory for better organization.
1732
- Fixed a regression bug affecting meshes which have domain elements which are not
1833
assigned material properties in the configuration file.
34+
- Changed layout and names of `palace/` source directory for better organization.
1935
- Added many updates to build system: Removed use of Git submodules to download
2036
dependencies relying instead directly on CMake's ExternalProject, patch GSLIB dependency
2137
for shared library builds, add CI tests with ARPACK-NG instead of SLEPc, update all
2238
dependency versions including MFEM to incorporate bug fixes and improvements. This
2339
affects the Spack package recipe, so a new recipe is distributed as part of Palace in
2440
in `spack/` which will keep compatibility with `main` while changes are upstreamed to
2541
the built-in Spack repository.
26-
- Add a basic Makefile with some useful targets for development.
42+
- Added a basic Makefile with some useful targets for development.
2743

2844
## [0.11.1] - 2023-05-03
2945

docs/src/config/solver.md

+49-24
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,16 @@ directory specified by [`config["Problem"]["Output"]`]
299299
"Tol": <float>,
300300
"MaxIts": <int>,
301301
"MaxSize": <int>,
302-
"UseGMG": <bool>,
303-
"UsePCShifted": <bool>,
302+
"UsePCMatShifted": <bool>,
303+
"PCSide": <string>,
304+
"UseMultigrid": <bool>,
305+
"MGAuxiliarySmoother": <bool>,
304306
"MGCycleIts": <int>,
305307
"MGSmoothIts": <int>,
306-
"MGSmoothOrder": <int>
308+
"MGSmoothOrder": <int>,
309+
"DivFreeTol": <float>,
310+
"DivFreeMaxIts": <float>,
311+
"Orthogonalization": <string>
307312
}
308313
```
309314

@@ -353,46 +358,66 @@ equations arising for each simulation type. The available options are:
353358
definite (SPD) and the preconditioned conjugate gradient method (`"CG"`) is used as the
354359
Krylov solver.
355360

356-
`"Tol" [1.0e-6]` : Relative (preconditioned) residual convergence tolerance for the
357-
iterative linear solver.
361+
`"Tol" [1.0e-6]` : Relative residual convergence tolerance for the iterative linear solver.
358362

359363
`"MaxIts" [100]` : Maximum number of iterations for the iterative linear solver.
360364

361365
`"MaxSize" [0]` : Maximum Krylov space size for the GMRES and FGMRES solvers. A value less
362366
than 1 defaults to the value specified by `"MaxIts"`.
363367

364-
`"UseGMG" [true]` : Enable or not [geometric multigrid solver]
365-
(https://en.wikipedia.org/wiki/Multigrid_method) which uses h- and p-multigrid coarsening as
366-
available to construct the multigrid hierarchy. The solver specified by `"Type"` is used on
367-
the coarsest level. A Hiptmair smoother is applied to all other levels.
368-
369-
`"UsePCShifted" [false]` : When set to `true`, constructs the preconditioner for frequency
368+
`"UsePCMatShifted" [false]` : When set to `true`, constructs the preconditioner for frequency
370369
domain problems using a real SPD approximation of the system matrix, which can help
371370
performance at high frequencies (relative to the lowest nonzero eigenfrequencies of the
372371
model).
373372

373+
`"PCSide" ["Default"]` : Side for preconditioning. Not all options are available for all
374+
iterative solver choices, and the default choice depends on the iterative solver used.
375+
376+
- `"Left"`
377+
- `"Right"`
378+
- `"Default"`
379+
380+
`"UseMultigrid" [true]` : Chose whether to enable [geometric multigrid preconditioning]
381+
(https://en.wikipedia.org/wiki/Multigrid_method) which uses p- and h-multigrid coarsening as
382+
available to construct the multigrid hierarchy. The solver specified by `"Type"` is used on
383+
the coarsest level. Relaxation on the fine levels is performed with Chebyshev smoothing.
384+
385+
`"MGAuxiliarySmoother"` : Activate hybrid smoothing from Hiptmair for multigrid levels when
386+
`"UseMultigrid"` is `true`. For non-singular problems involving curl-curl operators, this
387+
option is `true` by default.
388+
374389
`"MGCycleIts" [1]` : Number of V-cycle iterations per preconditioner application for
375-
multigrid preconditioners (when `"UseGMG"` is `true` or `"Type"` is `"AMS"` or
390+
multigrid preconditioners (when `"UseMultigrid"` is `true` or `"Type"` is `"AMS"` or
376391
`"BoomerAMG"`).
377392

378393
`"MGSmoothIts" [1]` : Number of pre- and post-smooth iterations used for multigrid
379-
preconditioners (when `"UseGMG"` is `true` or `"Type"` is `"AMS"` or `"BoomerAMG"`).
394+
preconditioners (when `"UseMultigrid"` is `true` or `"Type"` is `"AMS"` or `"BoomerAMG"`).
380395

381396
`"MGSmoothOrder" [3]` : Order of polynomial smoothing for geometric multigrid
382-
preconditioning (when `"UseGMG"` is `true`).
397+
preconditioning (when `"UseMultigrid"` is `true`).
398+
399+
`"DivFreeTol" [1.0e-12]` : Relative tolerance for divergence-free cleaning used in the
400+
eigenmode simulation type.
401+
402+
`"DivFreeMaxIts" [100]` : Maximum number of iterations for divergence-free cleaning use in
403+
the eigenmode simulation type.
404+
405+
`"Orthogonalization" ["MGS"]` : Gram-Schmidt variant used to explicitly orthogonalize
406+
vectors in Krylov subspace methods or other parts of the code.
407+
408+
- `"MGS"` : Modified Gram-Schmidt
409+
- `"CGS"` : Classical Gram-Schmidt
410+
- `"CGS2"` : Two-step classical Gram-Schmidt with reorthogonalization
383411

384412
### Advanced linear solver options
385413

386-
- `"Type"`: `"STRUMPACK-MP"`
387-
- `"KSPType"`: `"MINRES"`, `"CGSYM"`, `"FCG"`, `"BCGS"`, `"BCGSL"`, `"FBCGS"`, `"QMRCGS"`,
388-
`"TFQMR"`
389-
- `"UseMGS" [false]`
390-
- `"UseCGS2" [false]`
391-
- `"UseKSPPiped" [false]`
392-
- `"UseLOR" [false]`
393-
- `"PrecondSide" ["Default"]`: `"Left"`, `"Right"`, `"Default"`
394-
- `"Reordering" ["Default"]`: `"METIS"`, `"ParMETIS"`, `"Default"`
395-
- `"STRUMPACKCompressionType" ["None"]`: `"None"`, `"BLR"`, `"HSS"`, `"HODLR"`
414+
- `"UseInitialGuess" [true]`
415+
- `"UsePartialAssembly" [false]`
416+
- `"UseLowOrderRefined" [false]`
417+
- `"Reordering" ["Default"]` : `"METIS"`, `"ParMETIS"`,`"Scotch"`, `"PTScotch"`,
418+
`"Default"`
419+
- `"STRUMPACKCompressionType" ["None"]` : `"None"`, `"BLR"`, `"HSS"`, `"HODLR"`, `"ZFP"`,
420+
`"BLR-HODLR"`, `"ZFP-BLR-HODLR"`
396421
- `"STRUMPACKCompressionTol" [1.0e-3]`
397422
- `"STRUMPACKLossyPrecision" [16]`
398423
- `"STRUMPACKButterflyLevels" [1]`

docs/src/guide/model.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ or region-based refinement, specified using the [`config["Model"]["Refinement"]`
4040
uniform refinement levels as well as local refinement regions which refines the elements
4141
inside of a certain box or sphere-shaped region. For simplex meshes, the refinement
4242
maintains a conforming mesh but meshes containing hexahedra, prism, or pyramid elements
43-
will be non-conforming after local refinement (this is not supported at this time).
43+
will be nonconforming after local refinement (this is not supported at this time).
4444

4545
[Adaptive mesh refinement (AMR)](https://en.wikipedia.org/wiki/Adaptive_mesh_refinement)
4646
according to error estimates in the computed solution is a work in progress for all

palace/drivers/eigensolver.cpp

+1-3
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,7 @@ void EigenSolver::Solve(std::vector<std::unique_ptr<mfem::ParMesh>> &mesh,
117117
}
118118
slepc->SetProblemType(slepc::SlepcEigenSolver::ProblemType::GEN_NON_HERMITIAN);
119119
slepc->SetOrthogonalization(
120-
iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::MGS ||
121-
iodata.solver.linear.orthog_type ==
122-
config::LinearSolverData::OrthogType::DEFAULT,
120+
iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::MGS,
123121
iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::CGS2);
124122
eigen = std::move(slepc);
125123
#endif

palace/linalg/ksp.cpp

+19-22
Original file line numberDiff line numberDiff line change
@@ -95,30 +95,27 @@ std::unique_ptr<IterativeSolver<OperType>> ConfigureKrylovSolver(MPI_Comm comm,
9595
}
9696

9797
// Configure orthogonalization method for GMRES/FMGRES.
98-
if (iodata.solver.linear.orthog_type != config::LinearSolverData::OrthogType::DEFAULT)
98+
if (type != config::LinearSolverData::KspType::GMRES &&
99+
type != config::LinearSolverData::KspType::FGMRES)
99100
{
100-
if (type != config::LinearSolverData::KspType::GMRES &&
101-
type != config::LinearSolverData::KspType::FGMRES)
102-
{
103-
Mpi::Warning(comm, "Orthogonalization method will be ignored for non-GMRES/FGMRES "
104-
"iterative solvers!\n");
105-
}
106-
else
101+
Mpi::Warning(comm, "Orthogonalization method will be ignored for non-GMRES/FGMRES "
102+
"iterative solvers!\n");
103+
}
104+
else
105+
{
106+
// Because FGMRES inherits from GMRES, this is OK.
107+
auto *gmres = static_cast<GmresSolver<OperType> *>(ksp.get());
108+
switch (iodata.solver.linear.orthog_type)
107109
{
108-
// Because FGMRES inherits from GMRES, this is OK.
109-
auto *gmres = static_cast<GmresSolver<OperType> *>(ksp.get());
110-
switch (iodata.solver.linear.orthog_type)
111-
{
112-
case config::LinearSolverData::OrthogType::MGS:
113-
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::MGS);
114-
break;
115-
case config::LinearSolverData::OrthogType::CGS:
116-
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::CGS);
117-
break;
118-
case config::LinearSolverData::OrthogType::CGS2:
119-
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::CGS2);
120-
break;
121-
}
110+
case config::LinearSolverData::OrthogType::MGS:
111+
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::MGS);
112+
break;
113+
case config::LinearSolverData::OrthogType::CGS:
114+
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::CGS);
115+
break;
116+
case config::LinearSolverData::OrthogType::CGS2:
117+
gmres->SetOrthogonalization(GmresSolver<OperType>::OrthogType::CGS2);
118+
break;
122119
}
123120
}
124121

palace/models/romoperator.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,7 @@ RomOperator::RomOperator(const IoData &iodata, SpaceOperator &spaceop) : spaceop
123123
// The initial PROM basis is empty. Orthogonalization uses MGS by default, else CGS2.
124124
dim_V = 0;
125125
orthog_mgs =
126-
(iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::DEFAULT ||
127-
iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::MGS);
126+
(iodata.solver.linear.orthog_type == config::LinearSolverData::OrthogType::MGS);
128127

129128
// Seed the random number generator for parameter space sampling.
130129
engine.seed(std::chrono::system_clock::now().time_since_epoch().count());

palace/utils/configfile.cpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -1536,8 +1536,7 @@ NLOHMANN_JSON_SERIALIZE_ENUM(LinearSolverData::OrthogType,
15361536
{{LinearSolverData::OrthogType::INVALID, nullptr},
15371537
{LinearSolverData::OrthogType::MGS, "MGS"},
15381538
{LinearSolverData::OrthogType::CGS, "CGS"},
1539-
{LinearSolverData::OrthogType::CGS2, "CGS2"},
1540-
{LinearSolverData::OrthogType::DEFAULT, "Default"}})
1539+
{LinearSolverData::OrthogType::CGS2, "CGS2"}})
15411540

15421541
void LinearSolverData::SetUp(json &solver)
15431542
{

palace/utils/configfile.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -825,10 +825,9 @@ struct LinearSolverData
825825
MGS,
826826
CGS,
827827
CGS2,
828-
DEFAULT,
829828
INVALID = -1
830829
};
831-
OrthogType orthog_type = OrthogType::DEFAULT;
830+
OrthogType orthog_type = OrthogType::MGS;
832831

833832
void SetUp(json &solver);
834833
};

palace/utils/geodata.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ void RefineMesh(const IoData &iodata, std::vector<std::unique_ptr<mfem::ParMesh>
190190
mesh[0]->MeshGenerator() & 8))
191191
{
192192
// XX TODO: Region-based refinement won't work if the ParMesh has been constructed from
193-
// a conforming mesh, but non-conforming refinement is needed. Unclear if the
193+
// a conforming mesh, but nonconforming refinement is needed. Unclear if the
194194
// current mesh distribution scheme will work even for a conforming serial mesh
195195
// which is a NCMesh after Mesh::EnsureNCMesh is called.
196196
MFEM_ABORT("Region-based refinement is currently only supported for simplex meshes!");

scripts/schema/config/solver.json

+8-8
Original file line numberDiff line numberDiff line change
@@ -100,17 +100,16 @@
100100
"Tol": { "type": "number", "minimum": 0.0 },
101101
"MaxIts": { "type": "integer", "exclusiveMinimum": 0 },
102102
"MaxSize": { "type": "integer", "exclusiveMinimum": 0 },
103-
"UseMGS": { "type": "boolean" },
104-
"UseCGS2": { "type": "boolean" },
105103
"UseInitialGuess": { "type": "boolean" },
106-
"UseKSPPiped": { "type": "boolean" },
107-
"UseGMG": { "type": "boolean" },
108-
"UseLOR": { "type": "boolean" },
109-
"UsePCShifted": { "type": "boolean" },
104+
"UsePartialAssembly": { "type": "boolean" },
105+
"UseLowOrderRefined": { "type": "boolean" },
106+
"UsePCMatShifted": { "type": "boolean" },
107+
"PCSide": { "type": "string" },
108+
"UseMultigrid": { "type": "boolean" },
109+
"MGAuxiliarySmoother": { "type": "boolean" },
110110
"MGCycleIts": { "type": "integer", "exclusiveMinimum": 0 },
111111
"MGSmoothIts": { "type": "integer", "exclusiveMinimum": 0 },
112112
"MGSmoothOrder": { "type": "integer", "exclusiveMinimum": 0 },
113-
"PrecondSide": { "type": "string" },
114113
"Reordering": { "type": "string" },
115114
"STRUMPACKCompressionType": { "type": "string" },
116115
"STRUMPACKCompressionTol": { "type": "number", "minimum": 0.0 },
@@ -119,7 +118,8 @@
119118
"SuperLU3D": { "type": "boolean" },
120119
"AMSVector": { "type": "boolean" },
121120
"DivFreeTol": { "type": "number", "minimum": 0.0 },
122-
"DivFreeMaxIts": { "type": "integer", "minimum": 0 }
121+
"DivFreeMaxIts": { "type": "integer", "minimum": 0 },
122+
"Orthogonalization": { "type": "string" }
123123
}
124124
}
125125
}

0 commit comments

Comments
 (0)