xref: /libCEED/examples/solids/include/utils.h (revision 2b730f8b5a9c809740a0b3b302db43a719c636b1)
13d8e8822SJeremy L Thompson // Copyright (c) 2017-2022, Lawrence Livermore National Security, LLC and other CEED contributors.
23d8e8822SJeremy L Thompson // All Rights Reserved. See the top-level LICENSE and NOTICE files for details.
33d8e8822SJeremy L Thompson //
43d8e8822SJeremy L Thompson // SPDX-License-Identifier: BSD-2-Clause
53d8e8822SJeremy L Thompson //
63d8e8822SJeremy L Thompson // This file is part of CEED:  http://github.com/ceed
73d8e8822SJeremy L Thompson 
8b7c563b6SJeremy L Thompson #ifndef libceed_solids_examples_utils_h
9b7c563b6SJeremy L Thompson #define libceed_solids_examples_utils_h
105754ecacSJeremy L Thompson 
115754ecacSJeremy L Thompson #include <ceed.h>
125754ecacSJeremy L Thompson #include <petsc.h>
135754ecacSJeremy L Thompson 
145754ecacSJeremy L Thompson // Translate PetscMemType to CeedMemType
15*2b730f8bSJeremy L Thompson static inline CeedMemType MemTypeP2C(PetscMemType mem_type) { return PetscMemTypeDevice(mem_type) ? CEED_MEM_DEVICE : CEED_MEM_HOST; }
165754ecacSJeremy L Thompson 
17b7c563b6SJeremy L Thompson #endif  // libceed_solids_examples_utils_h
18