dm_utils.c (a74ce5e4fd35146128d8f10406f8f97da24f3002) dm_utils.c (49a40c8a2d720db341b0b117b89656b473cbebfb)
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/// @file

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

452 PetscCall(PetscFEGetDualSpace(fe_coord_current, &fe_coord_dual_space));
453 PetscCall(PetscDualSpaceGetOrder(fe_coord_dual_space, &fe_coord_order));
454
455 // Create FE for coordinates
456 PetscCheck(fe_coord_order == 1 || coord_order == 1, comm, PETSC_ERR_USER_INPUT,
457 "Only linear mesh geometry supported. Recieved %" PetscInt_FMT " order", fe_coord_order);
458 PetscCall(PetscFECreateLagrange(comm, dim, num_comp_coord, is_simplex, fe_coord_order, q_order, &fe_coord_new));
459 if (setup_faces) PetscCall(PetscFEGetHeightSubspace(fe_coord_new, 1, &fe_coord_face_new));
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/// @file

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

452 PetscCall(PetscFEGetDualSpace(fe_coord_current, &fe_coord_dual_space));
453 PetscCall(PetscDualSpaceGetOrder(fe_coord_dual_space, &fe_coord_order));
454
455 // Create FE for coordinates
456 PetscCheck(fe_coord_order == 1 || coord_order == 1, comm, PETSC_ERR_USER_INPUT,
457 "Only linear mesh geometry supported. Recieved %" PetscInt_FMT " order", fe_coord_order);
458 PetscCall(PetscFECreateLagrange(comm, dim, num_comp_coord, is_simplex, fe_coord_order, q_order, &fe_coord_new));
459 if (setup_faces) PetscCall(PetscFEGetHeightSubspace(fe_coord_new, 1, &fe_coord_face_new));
460 PetscCall(DMProjectCoordinates(dm, fe_coord_new));
460 PetscCall(DMSetCoordinateDisc(dm, fe_coord_new, PETSC_TRUE));
461 PetscCall(DMLocalizeCoordinates(dm)); // Update CellCoordinateDM with projected coordinates
462 PetscCall(PetscFEDestroy(&fe_coord_new));
463 }
464 PetscFunctionReturn(PETSC_SUCCESS);
465}
466
467/**
468 @brief Finish setting up `DM`

--- 51 unchanged lines hidden ---
461 PetscCall(DMLocalizeCoordinates(dm)); // Update CellCoordinateDM with projected coordinates
462 PetscCall(PetscFEDestroy(&fe_coord_new));
463 }
464 PetscFunctionReturn(PETSC_SUCCESS);
465}
466
467/**
468 @brief Finish setting up `DM`

--- 51 unchanged lines hidden ---