diff -Nru gismo-202206101801/debian/changelog gismo-202206281846/debian/changelog --- gismo-202206101801/debian/changelog 2022-06-10 18:01:31.000000000 +0000 +++ gismo-202206281846/debian/changelog 2022-06-28 18:46:21.000000000 +0000 @@ -1,8 +1,8 @@ -gismo (202206101801-4d810d75~ubuntu21.10.1) impish; urgency=low +gismo (202206281846-2bc55ba1~ubuntu21.10.1) impish; urgency=low * Auto build. - -- Gismo Fri, 10 Jun 2022 18:01:31 +0000 + -- Gismo Tue, 28 Jun 2022 18:46:21 +0000 gismo (20150926-ppa) trusty; urgency=medium diff -Nru gismo-202206101801/debian/git-build-recipe.manifest gismo-202206281846/debian/git-build-recipe.manifest --- gismo-202206101801/debian/git-build-recipe.manifest 2022-06-10 18:01:31.000000000 +0000 +++ gismo-202206281846/debian/git-build-recipe.manifest 2022-06-28 18:46:21.000000000 +0000 @@ -1,3 +1,3 @@ -# git-build-recipe format 0.4 deb-version 202206101801-4d810d75 -lp:g+smo git-commit:4d810d754d7a6b871033d85134b8e14156784fb2 +# git-build-recipe format 0.4 deb-version 202206281846-2bc55ba1 +lp:g+smo git-commit:2bc55ba1636a4443c9a922d4af0bc607ab4682ba nest master lp:~g+smo/+git/debian debian git-commit:d90315f41c6a444240614901a3f5b32d01a4d590 diff -Nru gismo-202206101801/src/gsAssembler/gsExpressions.h gismo-202206281846/src/gsAssembler/gsExpressions.h --- gismo-202206101801/src/gsAssembler/gsExpressions.h 2022-06-10 18:01:31.000000000 +0000 +++ gismo-202206281846/src/gsAssembler/gsExpressions.h 2022-06-28 18:46:20.000000000 +0000 @@ -134,6 +134,7 @@ template class abs_expr; template class pow_expr; template class sign_expr; +template class ppart_expr; template class cdiam_expr; template class temp_expr; template class mult_expr @@ -241,6 +242,10 @@ sign_expr sgn() const { return sign_expr(static_cast(*this)); } + /// Returns the expression's positive part + ppart_expr ppart() const + { return ppart_expr(static_cast(*this)); } + /// Returns an evaluation of the (sub-)expression in temporary memory temp_expr temp() const { return temp_expr(static_cast(*this)); } @@ -2164,6 +2169,41 @@ void print(std::ostream &os) const { os<<"sgn("; _u.print(os); os <<")"; } }; +/** + Expression for the component-wise positive part +*/ +template +class ppart_expr : public _expr > +{ +public: + typedef typename E::Scalar Scalar; + enum {ScalarValued = E::ScalarValued, Space = E::Space, ColBlocks= E::ColBlocks}; +private: + typename E::Nested_t _u; + mutable gsMatrix res; +public: + + ppart_expr(_expr const& u) : _u(u) { } + + const gsMatrix & eval(index_t k) const + { + res = _u.eval(k).cwiseMax(0.0); // component-wise maximum with zero + return res; + } + + + const index_t rows() const { return _u.rows(); } + const index_t cols() const { return _u.cols(); } + + void parse(gsExprHelper & el) const + { _u.parse(el); } + + const gsFeSpace & rowVar() const {return _u.rowVar();} + const gsFeSpace & colVar() const {return _u.colVar();} + + void print(std::ostream &os) const { os<<"posPart("; _u.print(os); os <<")"; } +}; + template class pow_expr : public _expr > diff -Nru gismo-202206101801/src/gsCore/gsMultiPatch.h gismo-202206281846/src/gsCore/gsMultiPatch.h --- gismo-202206101801/src/gsCore/gsMultiPatch.h 2022-06-10 18:01:31.000000000 +0000 +++ gismo-202206281846/src/gsCore/gsMultiPatch.h 2022-06-28 18:46:20.000000000 +0000 @@ -298,10 +298,11 @@ /// to two points: the lower and upper corner of the bounding box. void boundingBox(gsMatrix & result) const; - /// \brief Splits each patch uniformly in each direction into two new patches, - /// giving a total number of 2^d new patches. This method allocated new - /// space for each new geometry, the original one stays unchanged. - gsMultiPatch uniformSplit() const; + /// \brief Splits each patch uniformly in each direction (if dir = -1) + /// into two new patches, giving a total number of 2^d new patches per patch. + /// If dir is a parametric direction, then it only splits in that one direction. + /// This method allocated new space for each new geometry, the original one stays unchanged. + gsMultiPatch uniformSplit(index_t dir =-1) const; /** @brief Checks if all patch-interfaces are fully matching, and if not, repairs them, i.e., makes them fully matching. diff -Nru gismo-202206101801/src/gsCore/gsMultiPatch.hpp gismo-202206281846/src/gsCore/gsMultiPatch.hpp --- gismo-202206101801/src/gsCore/gsMultiPatch.hpp 2022-06-10 18:01:31.000000000 +0000 +++ gismo-202206281846/src/gsCore/gsMultiPatch.hpp 2022-06-28 18:46:20.000000000 +0000 @@ -311,15 +311,19 @@ } template -gsMultiPatch gsMultiPatch::uniformSplit() const +gsMultiPatch gsMultiPatch::uniformSplit(index_t dir) const { - int n = math::exp2(parDim()); + int n; + if (dir == -1) + n = math::exp2(parDim()); + else + n = 2; std::vector*> result; result.reserve(nPatches() * n); for (size_t np = 0; np < nPatches(); ++np) { - std::vector*> result_temp = m_patches[np]->uniformSplit(); + std::vector*> result_temp = m_patches[np]->uniformSplit(dir); result.insert(result.end(), result_temp.begin(), result_temp.end()); } gsMultiPatch mp(result);