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