/*---------------------------------------------------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License This file is part of OpenFOAM. OpenFOAM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OpenFOAM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenFOAM. If not, see . Class Foam::VectorSpaceOps Description Operator functions for VectorSpace. \*---------------------------------------------------------------------------*/ #ifndef VectorSpaceOps_H #define VectorSpaceOps_H // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // template class VectorSpaceOps { public: static const int endLoop = (I < N-1) ? 1 : 0; template static inline void eqOpS(V& vs, const S& s, EqOp eo) { eo(vs.v_[I], s); VectorSpaceOps::eqOpS(vs, s, eo); } template static inline void SeqOp(S& s, const V& vs, EqOp eo) { eo(s, vs.v_[I]); VectorSpaceOps::SeqOp(s, vs, eo); } template static inline void eqOp(V1& vs1, const V2& vs2, EqOp eo) { eo(vs1.v_[I], vs2.v_[I]); VectorSpaceOps::eqOp(vs1, vs2, eo); } template static inline void opVS(V& vs, const V1& vs1, const S& s, Op o) { vs.v_[I] = o(vs1.v_[I], s); VectorSpaceOps::opVS(vs, vs1, s, o); } template static inline void opSV(V& vs, const S& s, const V1& vs1, Op o) { vs.v_[I] = o(s, vs1.v_[I]); VectorSpaceOps::opSV(vs, s, vs1, o); } template static inline void op(V& vs, const V1& vs1, const V1& vs2, Op o) { vs.v_[I] = o(vs1.v_[I], vs2.v_[I]); VectorSpaceOps::op(vs, vs1, vs2, o); } }; template<> class VectorSpaceOps<0, 0> { public: template static inline void eqOpS(V&, const S&, EqOp) {} template static inline void SeqOp(S&, const V&, EqOp) {} template static inline void eqOp(V1&, const V2&, EqOp) {} template static inline void opVS(V& vs, const V1&, const S&, Op) {} template static inline void opSV(V& vs, const S&, const V1&, Op) {} template static inline void op(V& vs, const V1&, const V1&, Op) {} }; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* //