xref: /libCEED/examples/solids/include/boundary.h (revision 3d8e882215d238700cdceb37404f76ca7fa24eaa)
1*3d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
2*3d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
3*3d8e8822SJeremy L Thompson //
4*3d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
5*3d8e8822SJeremy L Thompson //
6*3d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
7*3d8e8822SJeremy L Thompson 
8b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_boundary_h
9b7c563b6SJeremy L Thompson #define libceed_solids_examples_boundary_h
105754ecacSJeremy L Thompson 
115754ecacSJeremy L Thompson #include <petsc.h>
125754ecacSJeremy L Thompson 
135754ecacSJeremy L Thompson typedef PetscErrorCode BCFunc(PetscInt, PetscReal, const PetscReal *, PetscInt,
145754ecacSJeremy L Thompson                               PetscScalar *, void *);
155754ecacSJeremy L Thompson BCFunc BCMMS, BCZero, BCClamp;
165754ecacSJeremy L Thompson 
175754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
185754ecacSJeremy L Thompson // Boundary Functions
195754ecacSJeremy L Thompson // -----------------------------------------------------------------------------
205754ecacSJeremy L Thompson // Note: If additional boundary conditions are added, an update is needed in
215754ecacSJeremy L Thompson //         elasticity.h for the boundaryOptions variable.
225754ecacSJeremy L Thompson 
235754ecacSJeremy L Thompson // BCMMS - boundary function
245754ecacSJeremy L Thompson // Values on all points of the mesh is set based on given solution below
255754ecacSJeremy L Thompson // for u[0], u[1], u[2]
265754ecacSJeremy L Thompson PetscErrorCode BCMMS(PetscInt dim, PetscReal load_increment,
275754ecacSJeremy L Thompson                      const PetscReal coords[], PetscInt num_comp_u,
285754ecacSJeremy L Thompson                      PetscScalar *u, void *ctx);
295754ecacSJeremy L Thompson 
305754ecacSJeremy L Thompson // BCClamp - fix boundary values with affine transformation at fraction of load
315754ecacSJeremy L Thompson //   increment
325754ecacSJeremy L Thompson PetscErrorCode BCClamp(PetscInt dim, PetscReal load_increment,
335754ecacSJeremy L Thompson                        const PetscReal coords[], PetscInt num_comp_u,
345754ecacSJeremy L Thompson                        PetscScalar *u, void *ctx);
355754ecacSJeremy L Thompson 
36b7c563b6SJeremy L Thompson #endif // libceed_solids_examples_boundary_h
37