Home
last modified time | relevance | path

Searched full:ksp (Results 1 – 22 of 22) sorted by relevance

/honee/src/
H A Dhonee-ksp.c5 /// KSP related functiosn for HONEE
9 PetscErrorCode KSPPostSolve_Honee(KSP ksp, Vec rhs, Vec x, void *ctx) { in KSPPostSolve_Honee() argument
13 PetscViewer viewer = PETSC_VIEWER_STDOUT_(PetscObjectComm((PetscObject)ksp)); in KSPPostSolve_Honee()
16 PetscCall(KSPGetResidualHistory(ksp, &residual_history, &num_its)); in KSPPostSolve_Honee()
19 PetscCall(PetscObjectGetTabLevel((PetscObject)ksp, &tab_level)); in KSPPostSolve_Honee()
21 …PetscCall(PetscViewerASCIIPrintf(viewer, "KSP Residual Summary: R_0 %.4e R_last %.4e R_last/R_0 %.… in KSPPostSolve_Honee()
H A Dpetsc_ops.c294 * @brief Return Mats for KSP solve
296 …* Uses command-line flag with `ksp`'s prefix to determine if mat_ceed should be used directly or w…
299 …d`, then `Pmat` is either assembled or uses `mat_ceed` based on the preconditioner choice in `ksp`.
301 * @param[in] ksp `KSP` object for used for solving
307 PetscErrorCode CreateSolveOperatorsFromMatCeed(KSP ksp, Mat mat_ceed, PetscBool assemble, Mat *Amat… in CreateSolveOperatorsFromMatCeed() argument
314 PetscCall(KSPGetOptionsPrefix(ksp, &ksp_prefix)); in CreateSolveOperatorsFromMatCeed()
316 …PetscCall(PetscOptionsBool("-matceed_assemble_amat", "Assemble the A matrix for KSP solve", NULL, … in CreateSolveOperatorsFromMatCeed()
323 PetscCall(KSPSetResidualHistory(ksp, NULL, PETSC_DECIDE, PETSC_TRUE)); in CreateSolveOperatorsFromMatCeed()
324 PetscCall(KSPSetPostSolve(ksp, KSPPostSolve_Honee, NULL)); in CreateSolveOperatorsFromMatCeed()
343 PetscCall(KSPGetPC(ksp, &pc)); in CreateSolveOperatorsFromMatCeed()
[all …]
H A Dgrid_anisotropy_tensor.c71 { // Setup KSP for L^2 projection in GridAnisotropyTensorProjectionSetupApply()
84 PetscCall(KSPCreate(comm, &grid_aniso_proj->ksp)); in GridAnisotropyTensorProjectionSetupApply()
85 PetscCall(KSPSetOptionsPrefix(grid_aniso_proj->ksp, "grid_anisotropy_tensor_projection_")); in GridAnisotropyTensorProjectionSetupApply()
88 PetscCall(KSPGetPC(grid_aniso_proj->ksp, &pc)); in GridAnisotropyTensorProjectionSetupApply()
91 PetscCall(KSPSetType(grid_aniso_proj->ksp, KSPCG)); in GridAnisotropyTensorProjectionSetupApply()
92 PetscCall(KSPSetNormType(grid_aniso_proj->ksp, KSP_NORM_NATURAL)); in GridAnisotropyTensorProjectionSetupApply()
93 …PetscCall(KSPSetTolerances(grid_aniso_proj->ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAUL… in GridAnisotropyTensorProjectionSetupApply()
95 PetscCall(KSPSetFromOptions_WithMatCeed(grid_aniso_proj->ksp, mat_mass)); in GridAnisotropyTensorProjectionSetupApply()
107 PetscCall(KSPSolve(grid_aniso_proj->ksp, Grid_Anisotropy, Grid_Anisotropy)); in GridAnisotropyTensorProjectionSetupApply()
H A Ddiff_flux_projection.c160 { // -- Setup KSP for L^2 projection in DivDiffFluxProjectionSetup_Direct()
165 PetscCall(KSPCreate(comm, &projection->ksp)); in DivDiffFluxProjectionSetup_Direct()
166 PetscCall(KSPSetOptionsPrefix(projection->ksp, "div_diff_flux_projection_")); in DivDiffFluxProjectionSetup_Direct()
169 PetscCall(KSPGetPC(projection->ksp, &pc)); in DivDiffFluxProjectionSetup_Direct()
172 PetscCall(KSPSetType(projection->ksp, KSPPREONLY)); in DivDiffFluxProjectionSetup_Direct()
174 PetscCall(KSPSetFromOptions_WithMatCeed(projection->ksp, mat_mass)); in DivDiffFluxProjectionSetup_Direct()
232 { // -- Setup KSP for L^2 projection in DivDiffFluxProjectionSetup_Indirect()
237 PetscCall(KSPCreate(comm, &projection->ksp)); in DivDiffFluxProjectionSetup_Indirect()
238 PetscCall(KSPSetOptionsPrefix(projection->ksp, "div_diff_flux_projection_")); in DivDiffFluxProjectionSetup_Indirect()
241 PetscCall(KSPGetPC(projection->ksp, &pc)); in DivDiffFluxProjectionSetup_Indirect()
[all …]
H A Dvelocity_gradient_projection.c121 // Setup KSP for L^2 projection with lumped mass operator in VelocityGradientProjectionSetup()
122 PetscCall(KSPCreate(PetscObjectComm((PetscObject)grad_velo_proj->dm), &grad_velo_proj->ksp)); in VelocityGradientProjectionSetup()
123 PetscCall(KSPSetOptionsPrefix(grad_velo_proj->ksp, "velocity_gradient_projection_")); in VelocityGradientProjectionSetup()
126 PetscCall(KSPGetPC(grad_velo_proj->ksp, &pc)); in VelocityGradientProjectionSetup()
129 PetscCall(KSPSetType(grad_velo_proj->ksp, KSPPREONLY)); in VelocityGradientProjectionSetup()
131 PetscCall(KSPSetFromOptions_WithMatCeed(grad_velo_proj->ksp, mat_mass)); in VelocityGradientProjectionSetup()
154 PetscCall(KSPSolve(grad_velo_proj->ksp, VelocityGradient, VelocityGradient)); in VelocityGradientProjectionApply()
H A Dsetupts.c445 KSP ksp; in TSSolve_NS() local
449 PetscCall(SNESGetKSP(snes, &ksp)); in TSSolve_NS()
450 … PetscCall(CreateSolveOperatorsFromMatCeed(ksp, honee->mat_ijacobian, PETSC_FALSE, &Amat, &Pmat)); in TSSolve_NS()
466 KSP ksp; in TSSolve_NS() local
469 PetscCall(SNESGetKSP(snes, &ksp)); in TSSolve_NS()
470 PetscCall(KSPSetResidualHistory(ksp, NULL, PETSC_DECIDE, PETSC_TRUE)); in TSSolve_NS()
471 PetscCall(KSPSetPostSolve(ksp, KSPPostSolve_Honee, NULL)); in TSSolve_NS()
513 KSP ksp; in TSSolve_NS() local
521 PetscCall(SNESGetKSP(snes, &ksp)); in TSSolve_NS()
522 PetscCall(KSPGetTolerances(ksp, &rtol_ksp, NULL, NULL, NULL)); in TSSolve_NS()
[all …]
H A Ddifferential_filter.c93 { // Setup LHS Operator and KSP for the differential filtering solve in DifferentialFilterCreateOperators()
169 PetscCall(KSPCreate(PetscObjectComm((PetscObject)dm_filter), &diff_filter->ksp)); in DifferentialFilterCreateOperators()
170 PetscCall(KSPSetOptionsPrefix(diff_filter->ksp, "diff_filter_")); in DifferentialFilterCreateOperators()
173 PetscCall(KSPGetPC(diff_filter->ksp, &pc)); in DifferentialFilterCreateOperators()
176 PetscCall(KSPSetType(diff_filter->ksp, KSPCG)); in DifferentialFilterCreateOperators()
177 PetscCall(KSPSetNormType(diff_filter->ksp, KSP_NORM_NATURAL)); in DifferentialFilterCreateOperators()
178 … PetscCall(KSPSetTolerances(diff_filter->ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT)); in DifferentialFilterCreateOperators()
180 PetscCall(KSPSetFromOptions_WithMatCeed(diff_filter->ksp, mat_lhs)); in DifferentialFilterCreateOperators()
322 PetscCall(KSPSolve(diff_filter->ksp, RHS, Filtered_Solution)); in DifferentialFilterApply()
366 PetscCall(KSPDestroy(&diff_filter_->ksp)); in DifferentialFilterDataDestroy()
H A Dsetuplibceed.c13 // @brief Create CeedOperator for unstabilized mass KSP for explicit timestepping
53 // @brief Create KSP to solve the inverse mass operator for explicit time stepping schemes
63 { // -- Setup KSP for mass operator in CreateKSPMass()
H A Dmisc.c195 PetscCall(KSPDestroy(&context_->ksp)); in NodalProjectionDataDestroy()
/honee/include/
H A Dpetsc_ops.h37 PetscErrorCode CreateSolveOperatorsFromMatCeed(KSP ksp, Mat mat_ceed, PetscBool assemble, Mat *Amat…
38 PetscErrorCode KSPSetFromOptions_WithMatCeed(KSP ksp, Mat mat_ceed);
H A Dnodal_projection.h10 KSP ksp; member
H A Ddifferential_filter.h15 KSP ksp; member
H A Dspanstats.h14 KSP ksp; // For the L^2 projection solve member
H A Dnavierstokes.h166 KSP mass_ksp;
361 PetscErrorCode KSPPostSolve_Honee(KSP ksp, Vec rhs, Vec x, void *ctx);
/honee/src/spanstats/
H A Dspanstats.c30 PetscCall(KSPDestroy(&spanstats_->ksp)); in SpanStatsCtxDestroy()
323 { // Setup KSP for L^2 projection in SpanwiseStatisticsSetupL2Projection()
325 KSP ksp; in SpanwiseStatisticsSetupL2Projection() local
329 PetscCall(KSPCreate(PetscObjectComm((PetscObject)spanstats->dm), &ksp)); in SpanwiseStatisticsSetupL2Projection()
330 PetscCall(KSPSetOptionsPrefix(ksp, spanstats->prefix)); in SpanwiseStatisticsSetupL2Projection()
333 PetscCall(KSPGetPC(ksp, &pc)); in SpanwiseStatisticsSetupL2Projection()
336 PetscCall(KSPSetType(ksp, KSPCG)); in SpanwiseStatisticsSetupL2Projection()
337 PetscCall(KSPSetNormType(ksp, KSP_NORM_NATURAL)); in SpanwiseStatisticsSetupL2Projection()
338 PetscCall(KSPSetTolerances(ksp, 1e-10, PETSC_DEFAULT, PETSC_DEFAULT, PETSC_DEFAULT)); in SpanwiseStatisticsSetupL2Projection()
340 PetscCall(KSPSetFromOptions_WithMatCeed(ksp, mat_mass)); in SpanwiseStatisticsSetupL2Projection()
[all …]
/honee/
H A DCHANGELOG.md24 - Add `-ksp_post_solve_residual` to print KSP residual summary information (can be done for `-mass`…
26 - Add `-mass_ksp_view_pre_ts_solve` to view the mass KSP once before `TSSolve()` is run
/honee/examples/
H A Dadvection.yaml13 ksp:
H A Dflatplate_STG.yaml16 ksp:
/honee/doc/
H A Druntime_options.md186 - View mass KSP once before `TSSolve()` is called
202 - View convergence reason for every iteration taken by the `KSP` solver
210 - Print KSP residual summary information after each
444 - Control the KSP object for the projection of the divergence of diffusive flux
/honee/src/smartsim/
H A Dsgs_dd_training.c320 PetscCall(KSPGetOperators(sgs_dd_train->diff_filter->ksp, &A_mat, NULL)); in TSMonitor_SGS_DD_Training()
/honee/problems/
H A Dadvection.c73 // @brief Create CeedOperator for stabilized mass KSP for explicit timestepping
H A Dnewtonian.c35 // @brief Create CeedOperator for stabilized mass KSP for explicit timestepping