| setup-dm.c (ce18bed930e8f3bfebcf709a18844aba97fe4630) | setup-dm.c (990fdeb6bb8fc9af2da4472bdc0d1f57da5da0e5) |
|---|---|
| 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 --- 118 unchanged lines hidden (view full) --- 127 } 128 } else { 129 // -- Mesh with user specified BCs 130 DMLabel label; 131 ierr = DMGetLabel(dm, "Face Sets", &label); CHKERRQ(ierr); 132 // -- Clamp BCs 133 for (PetscInt i = 0; i < app_ctx->bc_clamp_count; i++) { 134 char bcName[25]; | 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 --- 118 unchanged lines hidden (view full) --- 127 } 128 } else { 129 // -- Mesh with user specified BCs 130 DMLabel label; 131 ierr = DMGetLabel(dm, "Face Sets", &label); CHKERRQ(ierr); 132 // -- Clamp BCs 133 for (PetscInt i = 0; i < app_ctx->bc_clamp_count; i++) { 134 char bcName[25]; |
| 135 snprintf(bcName, sizeof bcName, "clamp_%d", app_ctx->bc_clamp_faces[i]); | 135 snprintf(bcName, sizeof bcName, "clamp_%" PetscInt_FMT, 136 app_ctx->bc_clamp_faces[i]); |
| 136 ierr = DMAddBoundary(dm, DM_BC_ESSENTIAL, bcName, label, 1, 137 &app_ctx->bc_clamp_faces[i], 0, 0, 138 NULL, (void(*)(void))BCClamp, NULL, 139 (void *)&app_ctx->bc_clamp_max[i], NULL); 140 CHKERRQ(ierr); 141 } 142 } 143 } 144 ierr = DMPlexSetClosurePermutationTensor(dm, PETSC_DETERMINE, NULL); 145 CHKERRQ(ierr); 146 147 // Cleanup 148 ierr = PetscFEDestroy(&fe); CHKERRQ(ierr); 149 150 PetscFunctionReturn(0); 151}; | 137 ierr = DMAddBoundary(dm, DM_BC_ESSENTIAL, bcName, label, 1, 138 &app_ctx->bc_clamp_faces[i], 0, 0, 139 NULL, (void(*)(void))BCClamp, NULL, 140 (void *)&app_ctx->bc_clamp_max[i], NULL); 141 CHKERRQ(ierr); 142 } 143 } 144 } 145 ierr = DMPlexSetClosurePermutationTensor(dm, PETSC_DETERMINE, NULL); 146 CHKERRQ(ierr); 147 148 // Cleanup 149 ierr = PetscFEDestroy(&fe); CHKERRQ(ierr); 150 151 PetscFunctionReturn(0); 152}; |