ceed_qfunctioncontext.py (777ff853944a0dbc06f7f09486fdf4674828e728) ceed_qfunctioncontext.py (9647a07ed4cccf5520ee61cfc49faed91542e405)
1# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3# reserved. See files LICENSE and NOTICE for details.
4#
5# This file is part of CEED, a collection of benchmarks, miniapps, software
6# libraries and APIs for efficient high-order finite element and spectral
7# element discretizations for exascale applications. For more information and
8# source code availability see http://github.com/ceed.

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

151 # Restore the QFunction Context's data
152 def restore_data(self):
153 """Restore an array obtained using get_data()."""
154
155 # Setup the pointer's pointer
156 data_pointer = ffi.new("CeedScalar **")
157
158 # libCEED call
1# Copyright (c) 2017, Lawrence Livermore National Security, LLC. Produced at
2# the Lawrence Livermore National Laboratory. LLNL-CODE-734707. All Rights
3# reserved. See files LICENSE and NOTICE for details.
4#
5# This file is part of CEED, a collection of benchmarks, miniapps, software
6# libraries and APIs for efficient high-order finite element and spectral
7# element discretizations for exascale applications. For more information and
8# source code availability see http://github.com/ceed.

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

151 # Restore the QFunction Context's data
152 def restore_data(self):
153 """Restore an array obtained using get_data()."""
154
155 # Setup the pointer's pointer
156 data_pointer = ffi.new("CeedScalar **")
157
158 # libCEED call
159 err_code = lib.CeedQFunctionDataRestoreData(self._pointer[0], data_pointer)
159 err_code = lib.CeedQFunctionDataRestoreData(
160 self._pointer[0], data_pointer)
160 self._ceed._check_error(err_code)
161
162 @contextlib.contextmanager
163 def data(self, *shape, memtype=MEM_HOST):
164 """Context manager for array access.
165
166 Args:
167 shape (tuple): shape of returned numpy.array

--- 13 unchanged lines hidden ---
161 self._ceed._check_error(err_code)
162
163 @contextlib.contextmanager
164 def data(self, *shape, memtype=MEM_HOST):
165 """Context manager for array access.
166
167 Args:
168 shape (tuple): shape of returned numpy.array

--- 13 unchanged lines hidden ---