ceed-ref-restriction.c (9475e04424868a13873cf56ff586117fff7168be) ceed-ref-restriction.c (0305e208bc4684eaa3113a3ca8b7ffdd1d4cb7a9)
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.h>

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

475 impl->offsets = impl->offsets_allocated;
476 break;
477 case CEED_USE_POINTER:
478 impl->offsets = offsets;
479 }
480
481 // Orientation data
482 if (rstr_type == CEED_RESTRICTION_ORIENTED) {
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.h>

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

475 impl->offsets = impl->offsets_allocated;
476 break;
477 case CEED_USE_POINTER:
478 impl->offsets = offsets;
479 }
480
481 // Orientation data
482 if (rstr_type == CEED_RESTRICTION_ORIENTED) {
483 CeedCheck(orients != NULL, ceed, CEED_ERROR_BACKEND, "No orients array provided for oriented restriction");
483 switch (copy_mode) {
484 case CEED_COPY_VALUES:
485 CeedCallBackend(CeedMalloc(num_elem * elem_size, &impl->orients_allocated));
486 memcpy(impl->orients_allocated, orients, num_elem * elem_size * sizeof(orients[0]));
487 impl->orients = impl->orients_allocated;
488 break;
489 case CEED_OWN_POINTER:
490 impl->orients_allocated = (bool *)orients;
491 impl->orients = impl->orients_allocated;
492 break;
493 case CEED_USE_POINTER:
494 impl->orients = orients;
495 }
496 } else if (rstr_type == CEED_RESTRICTION_CURL_ORIENTED) {
484 switch (copy_mode) {
485 case CEED_COPY_VALUES:
486 CeedCallBackend(CeedMalloc(num_elem * elem_size, &impl->orients_allocated));
487 memcpy(impl->orients_allocated, orients, num_elem * elem_size * sizeof(orients[0]));
488 impl->orients = impl->orients_allocated;
489 break;
490 case CEED_OWN_POINTER:
491 impl->orients_allocated = (bool *)orients;
492 impl->orients = impl->orients_allocated;
493 break;
494 case CEED_USE_POINTER:
495 impl->orients = orients;
496 }
497 } else if (rstr_type == CEED_RESTRICTION_CURL_ORIENTED) {
498 CeedCheck(curl_orients != NULL, ceed, CEED_ERROR_BACKEND, "No curl_orients array provided for oriented restriction");
497 switch (copy_mode) {
498 case CEED_COPY_VALUES:
499 CeedCallBackend(CeedMalloc(num_elem * 3 * elem_size, &impl->curl_orients_allocated));
500 memcpy(impl->curl_orients_allocated, curl_orients, num_elem * 3 * elem_size * sizeof(curl_orients[0]));
501 impl->curl_orients = impl->curl_orients_allocated;
502 break;
503 case CEED_OWN_POINTER:
504 impl->curl_orients_allocated = (CeedInt *)curl_orients;

--- 72 unchanged lines hidden ---
499 switch (copy_mode) {
500 case CEED_COPY_VALUES:
501 CeedCallBackend(CeedMalloc(num_elem * 3 * elem_size, &impl->curl_orients_allocated));
502 memcpy(impl->curl_orients_allocated, curl_orients, num_elem * 3 * elem_size * sizeof(curl_orients[0]));
503 impl->curl_orients = impl->curl_orients_allocated;
504 break;
505 case CEED_OWN_POINTER:
506 impl->curl_orients_allocated = (CeedInt *)curl_orients;

--- 72 unchanged lines hidden ---