ceed-basis.c (bce9d45699e9e5727e91ed35af4432904cdde2a5) ceed-basis.c (8bbba8cdca038b4242f0cbb369bb1e31b8a6e289)
1// Copyright (c) 2017-2024, 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>

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

326 CeedCall(CeedBasisGetNumQuadraturePoints1D(basis, &Q_1d));
327 CeedCall(CeedBasisGetNumComponents(basis, &num_comp));
328 CeedCall(CeedBasisGetNumQuadratureComponents(basis, eval_mode, &num_q_comp));
329 CeedCall(CeedBasisGetNumNodes(basis, &num_nodes));
330 CeedCall(CeedVectorGetLength(v, &v_length));
331 if (x_ref != CEED_VECTOR_NONE) CeedCall(CeedVectorGetLength(x_ref, &x_length));
332 if (u != CEED_VECTOR_NONE) CeedCall(CeedVectorGetLength(u, &u_length));
333
1// Copyright (c) 2017-2024, 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>

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

326 CeedCall(CeedBasisGetNumQuadraturePoints1D(basis, &Q_1d));
327 CeedCall(CeedBasisGetNumComponents(basis, &num_comp));
328 CeedCall(CeedBasisGetNumQuadratureComponents(basis, eval_mode, &num_q_comp));
329 CeedCall(CeedBasisGetNumNodes(basis, &num_nodes));
330 CeedCall(CeedVectorGetLength(v, &v_length));
331 if (x_ref != CEED_VECTOR_NONE) CeedCall(CeedVectorGetLength(x_ref, &x_length));
332 if (u != CEED_VECTOR_NONE) CeedCall(CeedVectorGetLength(u, &u_length));
333
334 // Check compatibility of topological and geometrical dimensions
335 CeedCheck((t_mode == CEED_TRANSPOSE && v_length % num_nodes == 0) || (t_mode == CEED_NOTRANSPOSE && u_length % num_nodes == 0) ||
336 (eval_mode == CEED_EVAL_WEIGHT),
337 ceed, CEED_ERROR_DIMENSION, "Length of input/output vectors incompatible with basis dimensions and number of points");
338
339 // Check compatibility coordinates vector
340 for (CeedInt i = 0; i < num_elem; i++) total_num_points += num_points[i];
341 CeedCheck((x_length >= total_num_points * dim) || (eval_mode == CEED_EVAL_WEIGHT), ceed, CEED_ERROR_DIMENSION,
342 "Length of reference coordinate vector incompatible with basis dimension and number of points."
343 " Found reference coordinate vector of length %" CeedSize_FMT ", not of length %" CeedSize_FMT ".",
344 x_length, total_num_points * dim);
345
346 // Check CEED_EVAL_WEIGHT only on CEED_NOTRANSPOSE

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

1814 CeedCall(CeedBasisGetDimension(basis, &dim));
1815 CeedCall(CeedBasisGetNumComponents(basis, &num_comp));
1816 CeedCall(CeedBasisGetNumQuadratureComponents(basis, eval_mode, &q_comp));
1817 CeedCall(CeedBasisGetNumNodes(basis, &num_nodes));
1818 CeedCall(CeedBasisGetNumQuadraturePoints(basis, &num_qpts));
1819 CeedCall(CeedVectorGetLength(v, &v_length));
1820 if (u) CeedCall(CeedVectorGetLength(u, &u_length));
1821
334 // Check compatibility coordinates vector
335 for (CeedInt i = 0; i < num_elem; i++) total_num_points += num_points[i];
336 CeedCheck((x_length >= total_num_points * dim) || (eval_mode == CEED_EVAL_WEIGHT), ceed, CEED_ERROR_DIMENSION,
337 "Length of reference coordinate vector incompatible with basis dimension and number of points."
338 " Found reference coordinate vector of length %" CeedSize_FMT ", not of length %" CeedSize_FMT ".",
339 x_length, total_num_points * dim);
340
341 // Check CEED_EVAL_WEIGHT only on CEED_NOTRANSPOSE

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

1809 CeedCall(CeedBasisGetDimension(basis, &dim));
1810 CeedCall(CeedBasisGetNumComponents(basis, &num_comp));
1811 CeedCall(CeedBasisGetNumQuadratureComponents(basis, eval_mode, &q_comp));
1812 CeedCall(CeedBasisGetNumNodes(basis, &num_nodes));
1813 CeedCall(CeedBasisGetNumQuadraturePoints(basis, &num_qpts));
1814 CeedCall(CeedVectorGetLength(v, &v_length));
1815 if (u) CeedCall(CeedVectorGetLength(u, &u_length));
1816
1822 // Check compatibility of topological and geometrical dimensions
1823 CeedCheck((t_mode == CEED_TRANSPOSE && v_length % num_nodes == 0 && u_length % num_qpts == 0) ||
1824 (t_mode == CEED_NOTRANSPOSE && u_length % num_nodes == 0 && v_length % num_qpts == 0),
1825 ceed, CEED_ERROR_DIMENSION, "Length of input/output vectors incompatible with basis dimensions");
1826
1827 // Check vector lengths to prevent out of bounds issues
1828 bool has_good_dims = true;
1829 switch (eval_mode) {
1830 case CEED_EVAL_NONE:
1831 case CEED_EVAL_INTERP:
1832 case CEED_EVAL_GRAD:
1833 case CEED_EVAL_DIV:
1834 case CEED_EVAL_CURL:

--- 584 unchanged lines hidden ---
1817 // Check vector lengths to prevent out of bounds issues
1818 bool has_good_dims = true;
1819 switch (eval_mode) {
1820 case CEED_EVAL_NONE:
1821 case CEED_EVAL_INTERP:
1822 case CEED_EVAL_GRAD:
1823 case CEED_EVAL_DIV:
1824 case CEED_EVAL_CURL:

--- 584 unchanged lines hidden ---