-
Notifications
You must be signed in to change notification settings - Fork 66
Expand file tree
/
Copy pathstructs.h
More file actions
83 lines (73 loc) · 2.81 KB
/
structs.h
File metadata and controls
83 lines (73 loc) · 2.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
// Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors.
// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
//
// SPDX-License-Identifier: BSD-2-Clause
//
// This file is part of CEED: http://github.com/ceed
/// @file
/// Data structures for PETSc examples
#pragma once
#include <ceed.h>
#include <petsc.h>
// -----------------------------------------------------------------------------
// PETSc Operator Structs
// -----------------------------------------------------------------------------
// Data for PETSc Matshell
typedef struct OperatorApplyContext_ *OperatorApplyContext;
struct OperatorApplyContext_ {
MPI_Comm comm;
DM dm;
Vec X_loc, Y_loc, diag;
CeedVector x_ceed, y_ceed;
CeedOperator op;
Ceed ceed;
};
// Data for PETSc Prolong/Restrict Matshells
typedef struct ProlongRestrContext_ *ProlongRestrContext;
struct ProlongRestrContext_ {
MPI_Comm comm;
DM dmc, dmf;
Vec loc_vec_c, loc_vec_f, mult_vec;
CeedVector ceed_vec_c, ceed_vec_f;
CeedOperator op_prolong, op_restrict;
Ceed ceed;
};
// -----------------------------------------------------------------------------
// libCEED Data Structs
// -----------------------------------------------------------------------------
// libCEED data struct for level
typedef struct CeedData_ *CeedData;
struct CeedData_ {
Ceed ceed;
CeedBasis basis_x, basis_u;
CeedElemRestriction elem_restr_x, elem_restr_u, elem_restr_u_i, elem_restr_qd_i;
CeedQFunction qf_apply;
CeedOperator op_apply, op_restrict, op_prolong;
CeedVector q_data, x_ceed, y_ceed;
CeedInt q_data_size;
};
// BP specific data
typedef struct {
CeedInt num_comp_x, num_comp_u, topo_dim, q_data_size, q_extra;
CeedQFunctionUser setup_geo, setup_rhs, apply, error;
const char *setup_geo_loc, *setup_rhs_loc, *apply_loc, *error_loc;
CeedEvalMode in_mode, out_mode;
CeedQuadMode q_mode;
PetscBool enforce_bc;
} BPData;
// BP options
typedef enum { CEED_BP1 = 0, CEED_BP2 = 1, CEED_BP3 = 2, CEED_BP4 = 3, CEED_BP5 = 4, CEED_BP6 = 5, CEED_BP13 = 6, CEED_BP24 = 7 } BPType;
// -----------------------------------------------------------------------------
// Parameter structure for running problems
// -----------------------------------------------------------------------------
typedef struct RunParams_ *RunParams;
struct RunParams_ {
MPI_Comm comm;
PetscBool test_mode, read_mesh, user_l_nodes, write_solution, simplex;
char *filename, *hostname;
PetscInt local_nodes, degree, q_extra, dim, num_comp_u, *mesh_elem;
PetscInt ksp_max_it_clip[2];
PetscMPIInt ranks_per_node;
BPType bp_choice;
PetscLogStage solve_stage;
};