xref: /honee/include/spanstats.h (revision 00e32f70de3d190502d6255d7b99184ba8963977)
1 // SPDX-FileCopyrightText: Copyright (c) 2017-2024, HONEE contributors.
2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
3 /// @file
4 /// Functions for setting up and performing spanwise-statistics collection
5 ///
6 /// "Parent" refers to the 2D plane on which statistics are collected *onto*.
7 /// "Child" refers to the 3D domain where statistics are gathered *from*.
8 /// Each quadrature point on the parent plane has several children in the child domain that it performs spanwise averaging with.
9 
10 #include <ceed.h>
11 #include <petsc.h>
12 #include <petsc_ops.h>
13 
14 typedef struct {
15   CeedElemRestriction elem_restr_parent_x, elem_restr_parent_stats, elem_restr_parent_colloc, elem_restr_child_colloc;
16   CeedBasis           basis_x, basis_stats;
17   CeedVector          x_coord;
18 } *SpanStatsSetupData;
19 
20 PetscErrorCode CreateSpanwiseStatsDM(void *honee_ctx, PetscInt degree, PetscInt num_comps, const char *prefix);
21 PetscErrorCode SpanwiseStatsSetupDataCreate(void *honee_ctx, SpanStatsSetupData *stats_data);
22 PetscErrorCode SpanwiseStatsSetupDataDestroy(SpanStatsSetupData data);
23 PetscErrorCode CreateSpanwiseStatsSF(void *honee_ctx, SpanStatsSetupData stats_data, DM parentdm, DM childdm, PetscSF *statssf);
24 PetscErrorCode SetupL2ProjectionSpanwiseStats(void *honee_ctx, SpanStatsSetupData stats_data, const char *prefix);
25 
26 PetscErrorCode CollectSpanwiseStatistics(void *honee_ctx, PetscScalar solution_time, Vec Q);
27 PetscErrorCode ProcessSpanwiseStatistics(void *honee_ctx, Vec stats);
28