ceed-basis.c (e347a4bc6835c6dc52c9f29e88d41c5100223d1d) ceed-basis.c (db002c03923317a1c3814dcd861330002c00a8ea)
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed-impl.h>

--- 895 unchanged lines hidden (view full) ---

904 CeedCheck(dim > 0, ceed, CEED_ERROR_DIMENSION, "Basis dimension must be a positive value");
905 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
906 CeedCheck(P_1d > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
907 CeedCheck(Q_1d > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
908
909 CeedElemTopology topo = dim == 1 ? CEED_TOPOLOGY_LINE : dim == 2 ? CEED_TOPOLOGY_QUAD : CEED_TOPOLOGY_HEX;
910
911 CeedCall(CeedCalloc(1, basis));
1// Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2// All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3//
4// SPDX-License-Identifier: BSD-2-Clause
5//
6// This file is part of CEED: http://github.com/ceed
7
8#include <ceed-impl.h>

--- 895 unchanged lines hidden (view full) ---

904 CeedCheck(dim > 0, ceed, CEED_ERROR_DIMENSION, "Basis dimension must be a positive value");
905 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
906 CeedCheck(P_1d > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
907 CeedCheck(Q_1d > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
908
909 CeedElemTopology topo = dim == 1 ? CEED_TOPOLOGY_LINE : dim == 2 ? CEED_TOPOLOGY_QUAD : CEED_TOPOLOGY_HEX;
910
911 CeedCall(CeedCalloc(1, basis));
912 (*basis)->ceed = ceed;
913 CeedCall(CeedReference(ceed));
912 CeedCall(CeedReferenceCopy(ceed, &(*basis)->ceed));
914 (*basis)->ref_count = 1;
915 (*basis)->is_tensor_basis = true;
916 (*basis)->dim = dim;
917 (*basis)->topo = topo;
918 (*basis)->num_comp = num_comp;
919 (*basis)->P_1d = P_1d;
920 (*basis)->Q_1d = Q_1d;
921 (*basis)->P = CeedIntPow(P_1d, dim);

--- 118 unchanged lines hidden (view full) ---

1040 CeedCall(CeedBasisCreateH1(delegate, topo, num_comp, num_nodes, num_qpts, interp, grad, q_ref, q_weight, basis));
1041 return CEED_ERROR_SUCCESS;
1042 }
1043
1044 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1045 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1046 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1047
913 (*basis)->ref_count = 1;
914 (*basis)->is_tensor_basis = true;
915 (*basis)->dim = dim;
916 (*basis)->topo = topo;
917 (*basis)->num_comp = num_comp;
918 (*basis)->P_1d = P_1d;
919 (*basis)->Q_1d = Q_1d;
920 (*basis)->P = CeedIntPow(P_1d, dim);

--- 118 unchanged lines hidden (view full) ---

1039 CeedCall(CeedBasisCreateH1(delegate, topo, num_comp, num_nodes, num_qpts, interp, grad, q_ref, q_weight, basis));
1040 return CEED_ERROR_SUCCESS;
1041 }
1042
1043 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1044 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1045 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1046
1048 CeedCall(CeedCalloc(1, basis));
1049
1050 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1051
1047 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1048
1052 (*basis)->ceed = ceed;
1053 CeedCall(CeedReference(ceed));
1049 CeedCall(CeedCalloc(1, basis));
1050 CeedCall(CeedReferenceCopy(ceed, &(*basis)->ceed));
1054 (*basis)->ref_count = 1;
1055 (*basis)->is_tensor_basis = false;
1056 (*basis)->dim = dim;
1057 (*basis)->topo = topo;
1058 (*basis)->num_comp = num_comp;
1059 (*basis)->P = P;
1060 (*basis)->Q = Q;
1061 (*basis)->fe_space = CEED_FE_SPACE_H1;

--- 39 unchanged lines hidden (view full) ---

1101 CeedCall(CeedBasisCreateHdiv(delegate, topo, num_comp, num_nodes, num_qpts, interp, div, q_ref, q_weight, basis));
1102 return CEED_ERROR_SUCCESS;
1103 }
1104
1105 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1106 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1107 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1108
1051 (*basis)->ref_count = 1;
1052 (*basis)->is_tensor_basis = false;
1053 (*basis)->dim = dim;
1054 (*basis)->topo = topo;
1055 (*basis)->num_comp = num_comp;
1056 (*basis)->P = P;
1057 (*basis)->Q = Q;
1058 (*basis)->fe_space = CEED_FE_SPACE_H1;

--- 39 unchanged lines hidden (view full) ---

1098 CeedCall(CeedBasisCreateHdiv(delegate, topo, num_comp, num_nodes, num_qpts, interp, div, q_ref, q_weight, basis));
1099 return CEED_ERROR_SUCCESS;
1100 }
1101
1102 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1103 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1104 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1105
1109 CeedCall(CeedCalloc(1, basis));
1110
1111 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1112
1106 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1107
1113 (*basis)->ceed = ceed;
1114 CeedCall(CeedReference(ceed));
1108 CeedCall(CeedCalloc(1, basis));
1109 CeedCall(CeedReferenceCopy(ceed, &(*basis)->ceed));
1115 (*basis)->ref_count = 1;
1116 (*basis)->is_tensor_basis = false;
1117 (*basis)->dim = dim;
1118 (*basis)->topo = topo;
1119 (*basis)->num_comp = num_comp;
1120 (*basis)->P = P;
1121 (*basis)->Q = Q;
1122 (*basis)->fe_space = CEED_FE_SPACE_HDIV;

--- 40 unchanged lines hidden (view full) ---

1163 CeedCall(CeedBasisCreateHcurl(delegate, topo, num_comp, num_nodes, num_qpts, interp, curl, q_ref, q_weight, basis));
1164 return CEED_ERROR_SUCCESS;
1165 }
1166
1167 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1168 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1169 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1170
1110 (*basis)->ref_count = 1;
1111 (*basis)->is_tensor_basis = false;
1112 (*basis)->dim = dim;
1113 (*basis)->topo = topo;
1114 (*basis)->num_comp = num_comp;
1115 (*basis)->P = P;
1116 (*basis)->Q = Q;
1117 (*basis)->fe_space = CEED_FE_SPACE_HDIV;

--- 40 unchanged lines hidden (view full) ---

1158 CeedCall(CeedBasisCreateHcurl(delegate, topo, num_comp, num_nodes, num_qpts, interp, curl, q_ref, q_weight, basis));
1159 return CEED_ERROR_SUCCESS;
1160 }
1161
1162 CeedCheck(num_comp > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 component");
1163 CeedCheck(num_nodes > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 node");
1164 CeedCheck(num_qpts > 0, ceed, CEED_ERROR_DIMENSION, "Basis must have at least 1 quadrature point");
1165
1171 CeedCall(CeedCalloc(1, basis));
1172
1173 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1174 curl_comp = (dim < 3) ? 1 : dim;
1175
1166 CeedCall(CeedBasisGetTopologyDimension(topo, &dim));
1167 curl_comp = (dim < 3) ? 1 : dim;
1168
1176 (*basis)->ceed = ceed;
1177 CeedCall(CeedReference(ceed));
1169 CeedCall(CeedCalloc(1, basis));
1170 CeedCall(CeedReferenceCopy(ceed, &(*basis)->ceed));
1178 (*basis)->ref_count = 1;
1179 (*basis)->is_tensor_basis = false;
1180 (*basis)->dim = dim;
1181 (*basis)->topo = topo;
1182 (*basis)->num_comp = num_comp;
1183 (*basis)->P = P;
1184 (*basis)->Q = Q;
1185 (*basis)->fe_space = CEED_FE_SPACE_HCURL;

--- 643 unchanged lines hidden ---
1171 (*basis)->ref_count = 1;
1172 (*basis)->is_tensor_basis = false;
1173 (*basis)->dim = dim;
1174 (*basis)->topo = topo;
1175 (*basis)->num_comp = num_comp;
1176 (*basis)->P = P;
1177 (*basis)->Q = Q;
1178 (*basis)->fe_space = CEED_FE_SPACE_HCURL;

--- 643 unchanged lines hidden ---