| /petsc/src/dm/impls/plex/tests/ |
| H A D | ex60.c | 41 Vec metric; in main() local 114 PetscCall(DMPlexMetricCreateUniform(dm, 0, scaling, &metric)); in main() 124 PetscCall(DMPlexMetricCreateIsotropic(dm, 0, indicator, &metric)); in main() 148 PetscCall(DMPlexMetricCreate(dm, 0, &metric)); in main() 149 PetscCall(DMPlexComputeGradientClementInterpolant(dmGrad, gradient, metric)); in main() 150 PetscCall(VecViewFromOptions(metric, NULL, "-adapt_hessian_view")); in main() 165 PetscCall(VecDuplicate(metric, &metric1)); in main() 167 PetscCall(VecAXPY(metric1, 0.625, metric)); in main() 168 PetscCall(VecDuplicate(metric, &metric2)); in main() 170 PetscCall(VecAXPY(metric2, 2.5, metric)); in main() [all …]
|
| H A D | ex19.c | 64 static PetscErrorCode ComputeMetricSensor(DM dm, AppCtx *user, Vec *metric) in ComputeMetricSensor() argument 105 PetscCall(DMPlexMetricCreate(dm, 0, metric)); in ComputeMetricSensor() 107 PetscCall(DMPlexMetricNormalize(dmHess, H, PETSC_TRUE, PETSC_TRUE, *metric, determinant)); in ComputeMetricSensor() 117 static PetscErrorCode ComputeMetric(DM dm, AppCtx *user, Vec *metric) in ComputeMetric() argument 124 PetscCall(DMPlexMetricCreateUniform(dm, 0, lambda, metric)); in ComputeMetric() 126 PetscCall(ComputeMetricSensor(dm, user, metric)); in ComputeMetric() 135 PetscCall(DMPlexMetricCreate(dm, 0, metric)); in ComputeMetric() 140 PetscCall(VecGetArray(*metric, &met)); in ComputeMetric() 167 PetscCall(VecRestoreArray(*metric, &met)); in ComputeMetric() 265 Vec metric; in main() local [all …]
|
| H A D | ex41.c | 7 PetscBool metric; /* Flag to use metric adaptation, instead of tagging */ member 17 options->metric = PETSC_FALSE; in ProcessOptions() 23 …sBool("-metric", "Flag for metric refinement", "ex41.c", options->metric, &options->metric, NULL)); in ProcessOptions()
|
| /petsc/src/dm/impls/plex/ |
| H A D | plexadapt.c | 61 PetscScalar *metric, *eqns; in DMPlexLabelToMetricConstraint() local 73 PetscCall(VecGetArray(*metricVec, &metric)); in DMPlexLabelToMetricConstraint() 121 metric[v * 4 + 0] += vol * coarseRatio * sol[0]; in DMPlexLabelToMetricConstraint() 122 metric[v * 4 + 1] += vol * coarseRatio * sol[1]; in DMPlexLabelToMetricConstraint() 123 metric[v * 4 + 2] += vol * coarseRatio * sol[1]; in DMPlexLabelToMetricConstraint() 124 metric[v * 4 + 3] += vol * coarseRatio * sol[2]; in DMPlexLabelToMetricConstraint() 126 metric[v * 9 + 0] += vol * coarseRatio * sol[0]; in DMPlexLabelToMetricConstraint() 127 metric[v * 9 + 1] += vol * coarseRatio * sol[1]; in DMPlexLabelToMetricConstraint() 128 metric[v * 9 + 3] += vol * coarseRatio * sol[1]; in DMPlexLabelToMetricConstraint() 129 metric[v * 9 + 2] += vol * coarseRatio * sol[2]; in DMPlexLabelToMetricConstraint() [all …]
|
| H A D | plexmetric.c | 843 static PetscErrorCode DMPlexP1FieldCreate_Private(DM dm, PetscInt f, PetscInt size, Vec *metric) in DMPlexP1FieldCreate_Private() argument 859 PetscCall(DMCreateLocalVector(dm, metric)); in DMPlexP1FieldCreate_Private() 901 PetscErrorCode DMPlexMetricCreate(DM dm, PetscInt f, Vec *metric) in DMPlexMetricCreate() argument 916 PetscCall(VecCreate(comm, metric)); in DMPlexMetricCreate() 917 PetscCall(VecSetSizes(*metric, 1, PETSC_DECIDE)); in DMPlexMetricCreate() 918 PetscCall(VecSetFromOptions(*metric)); in DMPlexMetricCreate() 919 } else if (isotropic) PetscCall(DMPlexP1FieldCreate_Private(dm, f, 1, metric)); in DMPlexMetricCreate() 920 else PetscCall(DMPlexP1FieldCreate_Private(dm, f, Nd, metric)); in DMPlexMetricCreate() 942 PetscErrorCode DMPlexMetricCreateUniform(DM dm, PetscInt f, PetscReal alpha, Vec *metric) in DMPlexMetricCreateUniform() argument 946 PetscCall(DMPlexMetricCreate(dm, f, metric)); in DMPlexMetricCreateUniform() [all …]
|
| /petsc/src/binding/petsc4py/demo/legacy/dmplex/ |
| H A D | isotropic_adaptation.py | 19 metric = plex.metricCreate() variable 20 plex.metricIntersection2(metric1, metric2, metric) 21 metric1.axpy(-1, metric) 25 newplex = plex.adaptMetric(metric)
|
| H A D | anisotropic_adaptation.py | 90 metric = dmHess.metricCreate() variable 92 dmHess.metricNormalize(H, metric, det) 93 metric.setName("Metric") 95 viewer(metric) 98 plex = plex.adaptMetric(metric)
|
| /petsc/src/dm/impls/plex/adaptors/pragmatic/ |
| H A D | pragmaticadapt.c | 20 PetscReal *x, *y, *z, *metric; in DMAdaptMetric_Pragmatic_Plex() local 66 …ces, &x, numVertices, &y, numVertices, &z, numVertices * PetscSqr(dim), &metric, numCells * maxCon… in DMAdaptMetric_Pragmatic_Plex() 145 if (uniform) metric[Nd * v + dim * i + j] = PetscRealPart(met[0]); in DMAdaptMetric_Pragmatic_Plex() 146 else metric[Nd * v + dim * i + j] = PetscRealPart(met[v]); in DMAdaptMetric_Pragmatic_Plex() 147 } else metric[Nd * v + dim * i + j] = 0.0; in DMAdaptMetric_Pragmatic_Plex() 148 } else metric[Nd * v + dim * i + j] = PetscRealPart(met[Nd * v + dim * i + j]); in DMAdaptMetric_Pragmatic_Plex() 171 PetscStackCallExternalVoid("pragmatic_set_metric", pragmatic_set_metric(metric)); in DMAdaptMetric_Pragmatic_Plex() 239 PetscCall(PetscFree5(x, y, z, metric, cells)); in DMAdaptMetric_Pragmatic_Plex()
|
| /petsc/src/sys/classes/viewer/impls/draw/ftn-custom/ |
| H A D | zdrawvf.c | 22 PETSC_EXTERN void petscviewermonitorlgsetup_(PetscViewer *v, char *host, char *label, char *metric,… in petscviewermonitorlgsetup_() argument 28 FIXCHAR(metric, len3, t3); in petscviewermonitorlgsetup_()
|
| /petsc/src/dm/impls/plex/adaptors/mmg/ |
| H A D | mmgadapt.c | 25 PetscReal *vertices, *metric, *verticesNew, gradationFactor, hausdorffNumber; in DMAdaptMetric_Mmg_Plex() local 77 PetscCall(PetscMalloc2(numVertices * Neq, &metric, dim * numVertices, &vertices)); in DMAdaptMetric_Mmg_Plex() 139 if (uniform) metric[Neq * v + k] = PetscRealPart(met[0]); in DMAdaptMetric_Mmg_Plex() 140 else metric[Neq * v + k] = PetscRealPart(met[v]); in DMAdaptMetric_Mmg_Plex() 141 } else metric[Neq * v + k] = 0.0; in DMAdaptMetric_Mmg_Plex() 143 metric[Neq * v + k] = PetscRealPart(met[dim * dim * v + dim * i + j]); in DMAdaptMetric_Mmg_Plex() 174 PetscCallMMG_NONSTANDARD(MMG2D_Set_tensorSols, mmg_metric, metric); in DMAdaptMetric_Mmg_Plex() 191 PetscCallMMG_NONSTANDARD(MMG3D_Set_tensorSols, mmg_metric, metric); in DMAdaptMetric_Mmg_Plex() 198 PetscCall(PetscFree2(metric, vertices)); in DMAdaptMetric_Mmg_Plex()
|
| /petsc/doc/changes/ |
| H A D | 317.md | 224 - Add public API for metric-based mesh adaptation: 227 - Add `DMPlexMetricSetIsotropic()` for declaring whether a metric is isotropic 228 - Add `DMPlexMetricIsIsotropic()` for determining whether a metric is isotropic 229 - Add `DMPlexMetricSetUniform()` for declaring whether a metric is uniform 230 - Add `DMPlexMetricIsUniform()` for determining whether a metric is uniform 233 - Add `DMPlexMetricSetMinimumMagnitude()` for specifying the minimum tolerated metric magnitude 234 - Add `DMPlexMetricGetMinimumMagnitude()` for retrieving the minimum tolerated metric magnitude 235 - Add `DMPlexMetricSetMaximumMagnitude()` for specifying the maximum tolerated metric magnitude 236 - Add `DMPlexMetricGetMaximumMagnitude()` for retrieving the maximum tolerated metric magnitude 237 … - Add `DMPlexMetricSetMaximumAnisotropy()` for specifying the maximum tolerated metric anisostropy [all …]
|
| H A D | 316.md | 236 - Add `DMPlexMetricCreate` as a helper function for creating a (P1) Riemannian metric. 237 - Add `DMPlexMetricCreateUniform` as a helper function for creating a uniform metric. 238 - Add `DMPlexMetricCreateIsotropic` as a helper function for creating an isotropic metric. 239 - Add `DMPlexMetricEnforceSPD` for enforcing that a metric is symmetric positive-definite. 240 - Add `DMPlexMetricNormalize` to apply L-p metric normalization.
|
| H A D | 318.md | 273 - pass output metric, rather than its address 275 : - pass output metric, rather than its address 277 …)`, `DMPlexMetricAverage2()` and `DMPlexMetricAverage3()` to pass output metric, rather than its a… 278 …xMetricIntersection2()` and `DMPlexMetricIntersection3()` to pass output metric, rather than its a…
|
| H A D | 310.md | 55 - Added new matrix types for limited-memory variable-metric
|
| /petsc/src/binding/petsc4py/test/ |
| H A D | test_dmplex.py | 210 metric = self.plex.metricCreate() 212 self.plex.metricAverage2(metric1, metric2, metric) 214 self.assertTrue(np.allclose(metric.array, metric1.array)) 215 self.plex.metricIntersection2(metric1, metric2, metric) 216 self.assertTrue(np.allclose(metric.array, metric2.array)) 217 self.plex.metricEnforceSPD(metric, metric1, det[0]) 218 self.assertTrue(np.allclose(metric.array, metric1.array)) 225 metric, metric1, det[0], restrictSizes=False, restrictAnisotropy=False 248 metric = plex.metricCreateUniform(9.0) 250 newplex = plex.adaptMetric(metric, '')
|
| /petsc/src/binding/petsc4py/src/petsc4py/PETSc/ |
| H A D | DMPlex.pyx | 2400 """Record whether the metric is uniform or not. 2407 Flag indicating whether the metric is uniform or not. 2419 """Return the flag indicating whether the metric is uniform or not. 2434 """Record whether the metric is isotropic or not. 2441 Flag indicating whether the metric is isotropic or not. 2453 """Return the flag indicating whether the metric is isotropic or not. 2719 """Set the minimum tolerated metric magnitude. 2726 The minimum tolerated metric magnitude. 2738 """Return the minimum tolerated metric magnitude. 2753 """Set the maximum tolerated metric magnitude. [all …]
|
| H A D | DM.pyx | 1775 Vec metric, argument 1778 """Return a mesh adapted to the specified metric field. 1784 metric 1785 The metric to which the mesh is adapted, defined vertex-wise. 1806 CHKERR(DMAdaptMetric(self.dm, metric.vec, cbdlbl, crglbl, &newdm.dm))
|
| /petsc/src/dm/interface/ |
| H A D | dmgenerate.c | 220 PetscErrorCode DMAdaptMetric(DM dm, Vec metric, DMLabel bdLabel, DMLabel rgLabel, DM *dmAdapt) in DMAdaptMetric() argument 231 PetscValidHeaderSpecific(metric, VEC_CLASSID, 2); in DMAdaptMetric() 255 PetscCall((*fl->adapt)(dm, metric, bdLabel, rgLabel, dmAdapt)); in DMAdaptMetric()
|
| /petsc/src/dm/impls/plex/adaptors/parmmg/ |
| H A D | parmmgadapt.c | 29 …PetscReal *vertices, *metric, *verticesNew, *verticesNewLoc, gradationFactor, hausdorffNum… in DMAdaptMetric_ParMmg_Plex() local 123 PetscCall(PetscMalloc2(numUsedVertices * Neq, &metric, dim * numUsedVertices, &vertices)); in DMAdaptMetric_ParMmg_Plex() 199 if (uniform) metric[Neq * vv + k] = PetscRealPart(met[0]); in DMAdaptMetric_ParMmg_Plex() 200 else metric[Neq * vv + k] = PetscRealPart(met[v]); in DMAdaptMetric_ParMmg_Plex() 201 } else metric[Neq * vv + k] = 0.0; in DMAdaptMetric_ParMmg_Plex() 202 } else metric[Neq * vv + k] = PetscRealPart(met[dim * dim * v + dim * i + j]); in DMAdaptMetric_ParMmg_Plex() 364 PetscCallMMG_NONSTANDARD(PMMG_Set_tensorMets, parmesh, metric); in DMAdaptMetric_ParMmg_Plex() 374 PetscCall(PetscFree2(metric, vertices)); in DMAdaptMetric_ParMmg_Plex()
|
| /petsc/doc/manual/ |
| H A D | dmplex.md | 684 `DMPLEX` supports mesh adaptation using the *Riemannian metric framework*. 685 The idea is to use a Riemannian metric space within the mesher. The 686 metric space dictates how mesh resolution should be distributed across 688 that it is a *unit mesh* when viewed in the metric space. That is, the image 690 metric space has edges of unit length. 692 One of the main advantages of metric-based mesh adaptation is that it allows 698 See {cite}`alauzet2010` for further details on metric-based anisotropic mesh 701 The two main ingredients for metric-based mesh adaptation are an input mesh 702 (i.e. the `DMPLEX`) and a Riemannian metric. The implementation in PETSc assumes 703 that the metric is piecewise linear and continuous across elemental boundaries. [all …]
|
| /petsc/src/ts/tutorials/ |
| H A D | ex45.c | 369 Vec metric; in Remesh() local 371 PetscCall(DMPlexMetricCreateIsotropic(dmM, 0, locU, &metric)); in Remesh() 380 PetscCall(VecScale(metric, scale)); in Remesh() 381 PetscCall(VecViewFromOptions(metric, NULL, "-metric_view")); in Remesh() 385 PetscCall(DMAdaptMetric(dm, metric, label, NULL, newdm)); in Remesh() 386 PetscCall(VecDestroy(&metric)); in Remesh()
|
| /petsc/src/ksp/pc/impls/gamg/ |
| H A D | geo.c | 683 PetscReal metric, tm; in PCGAMGProlongator_GEO() local 686 …selected_2, data_stride, coords, nLocalSelected, clid_flid, agg_lists, crsGID, bs, Prol, &metric)); in PCGAMGProlongator_GEO() 692 PetscCallMPI(MPIU_Allreduce(&metric, &tm, 1, MPIU_REAL, MPIU_MAX, comm)); in PCGAMGProlongator_GEO() 696 } else if (metric > .0) { in PCGAMGProlongator_GEO() 697 PetscCall(PetscInfo(pc, "worst metric for coarse grid = %e\n", (double)metric)); in PCGAMGProlongator_GEO()
|
| /petsc/doc/overview/ |
| H A D | nutshell.md | 19 - {any}`Limited memory variable metric representations<sec_matlmvm>`,
|
| /petsc/src/snes/utils/dm/ |
| H A D | dmadapt.c | 1439 Vec xGrad, xHess, metric, determinant; in DMAdaptorAdapt_Sequence_Private() local 1501 PetscCall(DMPlexMetricCreate(dmMetric, 0, &metric)); in DMAdaptorAdapt_Sequence_Private() 1502 PetscCall(DMProjectFieldLocal(dmMetric, 0.0, xHess, funcs, INSERT_ALL_VALUES, metric)); in DMAdaptorAdapt_Sequence_Private() 1504 xHess = metric; in DMAdaptorAdapt_Sequence_Private() 1507 PetscCall(DMPlexMetricCreate(dmMetric, 0, &metric)); in DMAdaptorAdapt_Sequence_Private() 1509 … PetscCall(DMPlexMetricNormalize(dmMetric, xHess, PETSC_TRUE, PETSC_TRUE, metric, determinant)); in DMAdaptorAdapt_Sequence_Private() 1516 PetscCall(DMAdaptMetric(dm, metric, bdLabel, rgLabel, &odm)); in DMAdaptorAdapt_Sequence_Private() 1520 PetscCall(VecDestroy(&metric)); in DMAdaptorAdapt_Sequence_Private()
|
| /petsc/src/sys/classes/viewer/impls/draw/ |
| H A D | drawv.c | 683 …Up(PetscViewer viewer, const char host[], const char title[], const char metric[], PetscInt l, con… in PetscViewerMonitorLGSetUp() argument 695 PetscCall(PetscDrawAxisSetLabels(axis, "Convergence", "Iteration", metric)); in PetscViewerMonitorLGSetUp()
|