xref: /honee/include/dm-utils.h (revision 8314b5411f868d3fe195890853902f1e5e532354)
1 // SPDX-FileCopyrightText: Copyright (c) 2017-2025, HONEE contributors.
2 // SPDX-License-Identifier: Apache-2.0 OR BSD-2-Clause
3 #pragma once
4 
5 #include <ceed.h>
6 #include <petscdm.h>
7 
8 PetscErrorCode DMPlexCeedElemRestrictionCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height, PetscInt dm_field,
9                                                CeedElemRestriction *restriction);
10 PetscErrorCode DMPlexCeedElemRestrictionCoordinateCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height,
11                                                          CeedElemRestriction *restriction);
12 PetscErrorCode DMPlexCeedElemRestrictionQDataCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height,
13                                                     PetscInt q_data_size, CeedElemRestriction *restriction);
14 PetscErrorCode DMPlexCeedElemRestrictionCollocatedCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height,
15                                                          PetscInt q_data_size, CeedElemRestriction *restriction);
16 
17 PetscErrorCode DMPlexCeedBasisCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height, PetscInt dm_field,
18                                      CeedBasis *basis);
19 PetscErrorCode DMPlexCeedBasisCoordinateCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height, CeedBasis *basis);
20 PetscErrorCode DMPlexCeedCoordinateCreateField(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt height,
21                                                CeedElemRestriction *elem_restr, CeedBasis *basis, CeedVector *vector);
22 PetscErrorCode DMPlexCeedBasisCellToFaceCoordinateCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt face,
23                                                          CeedBasis *basis);
24 PetscErrorCode DMPlexCeedBasisCellToFaceCreate(Ceed ceed, DM dm, DMLabel domain_label, PetscInt label_value, PetscInt face, PetscInt dm_field,
25                                                CeedBasis *basis);
26 PetscErrorCode DMPlexCreateFaceLabel(DM dm, PetscInt dm_face, char **face_label_name);
27 PetscErrorCode DMLabelCreateGlobalValueArray(DM dm, DMLabel label, PetscInt *num_values, PetscInt **value_array);
28 
29 PetscErrorCode DMGetCoordinateNumComps(DM dm, PetscInt *num_comp_x);
30 PetscErrorCode DMGetFieldNumComps(DM dm, PetscInt field, PetscInt *num_comp);
31 
32 PetscErrorCode DMSetupByOrderBegin_FEM(PetscBool setup_faces, PetscBool setup_coords, PetscInt degree, PetscInt coord_order, PetscInt q_extra,
33                                        PetscInt num_fields, const PetscInt *field_sizes, DM dm);
34 PetscErrorCode DMSetupByOrderEnd_FEM(PetscBool setup_coords, DM dm);
35 PetscErrorCode DMSetupByOrder_FEM(PetscBool setup_faces, PetscBool setup_coords, PetscInt degree, PetscInt coord_order, PetscInt q_extra,
36                                   PetscInt num_fields, const PetscInt *field_sizes, DM dm);
37