qfunction.rs (bf55b007047d3d1ea1227af6b83a1b17e380b530) qfunction.rs (78c2cefab85ecc740ba63f6df2f5d30a7426d159)
1// Copyright (c) 2017-2025, 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//! A Ceed QFunction represents the spatial terms of the point-wise functions

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

134 fn from(qfunc: &'a QFunctionByName) -> Self {
135 debug_assert!(qfunc.qf_core.ptr != unsafe { bind_ceed::CEED_QFUNCTION_NONE });
136 Self::SomeQFunctionByName(qfunc)
137 }
138}
139
140impl<'a> QFunctionOpt<'a> {
141 /// Transform a Rust libCEED QFunctionOpt into C libCEED CeedQFunction
1// Copyright (c) 2017-2025, 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//! A Ceed QFunction represents the spatial terms of the point-wise functions

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

134 fn from(qfunc: &'a QFunctionByName) -> Self {
135 debug_assert!(qfunc.qf_core.ptr != unsafe { bind_ceed::CEED_QFUNCTION_NONE });
136 Self::SomeQFunctionByName(qfunc)
137 }
138}
139
140impl<'a> QFunctionOpt<'a> {
141 /// Transform a Rust libCEED QFunctionOpt into C libCEED CeedQFunction
142 pub(crate) fn to_raw(self) -> bind_ceed::CeedQFunction {
142 pub(crate) fn to_raw(&self) -> bind_ceed::CeedQFunction {
143 match self {
144 Self::SomeQFunction(qfunc) => qfunc.qf_core.ptr,
145 Self::SomeQFunctionByName(qfunc) => qfunc.qf_core.ptr,
146 Self::None => unsafe { bind_ceed::CEED_QFUNCTION_NONE },
147 }
148 }
149
150 /// Check if a QFunctionOpt is Some

--- 847 unchanged lines hidden ---
143 match self {
144 Self::SomeQFunction(qfunc) => qfunc.qf_core.ptr,
145 Self::SomeQFunctionByName(qfunc) => qfunc.qf_core.ptr,
146 Self::None => unsafe { bind_ceed::CEED_QFUNCTION_NONE },
147 }
148 }
149
150 /// Check if a QFunctionOpt is Some

--- 847 unchanged lines hidden ---