From c6b642b7f456f4b7eba927d0b7722214b0a98bb0 Mon Sep 17 00:00:00 2001 From: kmo Date: Thu, 1 Dec 2011 18:30:31 +0000 Subject: [PATCH] Removed doubly defined getSurface and getBasis methods in ASMs2Dmx git-svn-id: http://svn.sintef.no/trondheim/IFEM/trunk@1329 e10b68d5-8a6e-419e-a041-bce267b0401d --- src/ASM/ASM2D.C | 2 +- src/ASM/ASM2D.h | 1 + src/ASM/ASMs2D.h | 2 +- src/ASM/ASMs2Dmx.C | 29 +++++++++++------------------ src/ASM/ASMs2Dmx.h | 10 ++-------- src/ASM/ASMs3D.h | 2 +- src/ASM/ASMs3Dmx.h | 3 ++- 7 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/ASM/ASM2D.C b/src/ASM/ASM2D.C index b508fea3..f2d05cc4 100644 --- a/src/ASM/ASM2D.C +++ b/src/ASM/ASM2D.C @@ -21,7 +21,7 @@ #endif -ASMbase* ASM2D::create (ASM::Discretization discretization, +ASMbase* ASM2D::create (ASM::Discretization discretization, unsigned char* nf, bool mixedFEM) { switch (discretization) { diff --git a/src/ASM/ASM2D.h b/src/ASM/ASM2D.h index 770aefb1..809c941c 100644 --- a/src/ASM/ASM2D.h +++ b/src/ASM/ASM2D.h @@ -40,6 +40,7 @@ public: //! \brief Creates a two-parametric patch of specified discretization type. //! \param[in] type The discretization method to use //! \param[in] nf Number of unknown per basis function in the patch + //! \param[in] mixedFEM If \e true, force mixed formulation even if \a nf[1]=0 static ASMbase* create(ASM::Discretization type, unsigned char* nf, bool mixedFEM = false); diff --git a/src/ASM/ASMs2D.h b/src/ASM/ASMs2D.h index 6dcc5d1d..04bfbdf0 100644 --- a/src/ASM/ASMs2D.h +++ b/src/ASM/ASMs2D.h @@ -79,7 +79,7 @@ public: //! \brief Returns the spline surface representing the geometry of this patch. Go::SplineSurface* getSurface() const { return surf; } //! \brief Returns the spline surface representing the basis of this patch. - virtual Go::SplineSurface* getBasis() const { return surf; } + virtual Go::SplineSurface* getBasis(int = 1) const { return surf; } // Methods for model generation diff --git a/src/ASM/ASMs2Dmx.C b/src/ASM/ASMs2Dmx.C index 8a5b13b5..54fc953f 100644 --- a/src/ASM/ASMs2Dmx.C +++ b/src/ASM/ASMs2Dmx.C @@ -49,15 +49,6 @@ ASMs2Dmx::ASMs2Dmx (const ASMs2Dmx& patch, char n_f1, char n_f2) } -Go::SplineSurface* ASMs2Dmx::getBasis(int basis) const -{ - if (basis == 2) - return basis2; - else - return basis1; -} - - bool ASMs2Dmx::write (std::ostream& os, int basis) const { if (basis1 && basis == 1) @@ -163,13 +154,14 @@ bool ASMs2Dmx::generateFEMTopology () int ndim = surf->dimension(); Go::BsplineBasis b1 = surf->basis(0).extendedBasis(surf->order_u()+1); Go::BsplineBasis b2 = surf->basis(1).extendedBasis(surf->order_v()+1); - // To lower order and regularity this can be used -// std::vector::const_iterator first = ++surf->basis(0).begin(); -// std::vector::const_iterator last = --surf->basis(0).end(); -// Go::BsplineBasis b1 = Go::BsplineBasis(surf->order_u()-1,first,last); -// first = ++surf->basis(1).begin(); -// last = --surf->basis(1).end(); -// Go::BsplineBasis b2 = Go::BsplineBasis(surf->order_v()-1,first,last); + /* To lower order and regularity this can be used instead + std::vector::const_iterator first = ++surf->basis(0).begin(); + std::vector::const_iterator last = --surf->basis(0).end(); + Go::BsplineBasis b1 = Go::BsplineBasis(surf->order_u()-1,first,last); + first = ++surf->basis(1).begin(); + last = --surf->basis(1).end(); + Go::BsplineBasis b2 = Go::BsplineBasis(surf->order_v()-1,first,last); + */ // Note: Currently this is implemented for non-rational splines only. // TODO: Ask the splines people how to fix this properly, that is, how @@ -356,7 +348,7 @@ bool ASMs2Dmx::generateFEMTopology () int lnod = 0; for (j2 = p2-1; j2 >= 0; j2--) - for (j1 = p1-1; j1 >= 0; j1--) + for (j1 = p1-1; j1 >= 0; j1--) myMNPC[iel][lnod++] = inod - n1*j2 - j1; iel++; @@ -507,6 +499,7 @@ bool ASMs2Dmx::integrate (Integrand& integrand, Matrix dN1du, dN2du, Xnod, Jac; Vec4 X; + // === Assembly loop over all elements in the patch ========================== int iel = 1; @@ -577,7 +570,7 @@ bool ASMs2Dmx::integrate (Integrand& integrand, if (!integrand.evalIntMx(elmInt,fe,time,X)) return false; } - + // Assembly of global system integral if (!glInt.assemble(elmInt,fe.iel)) return false; diff --git a/src/ASM/ASMs2Dmx.h b/src/ASM/ASMs2Dmx.h index 143c4789..35e6e094 100644 --- a/src/ASM/ASMs2Dmx.h +++ b/src/ASM/ASMs2Dmx.h @@ -40,16 +40,10 @@ public: virtual ~ASMs2Dmx() {} //! \brief Returns the spline surface representing the basis of this patch. - virtual Go::SplineSurface* getBasis() const { return basis1; } + virtual Go::SplineSurface* getBasis(int basis = 1) const + { return basis == 2 ? basis2 : basis1; } - //! \brief Returns the spline surface representing this patch. - Go::SplineSurface* getSurface() const { return surf; } - - //! \brief Returns the spline surface representing this patch. - Go::SplineSurface* getBasis(int basis) const; - - // Methods for model generation // ============================ diff --git a/src/ASM/ASMs3D.h b/src/ASM/ASMs3D.h index 60fb4765..dbe64560 100644 --- a/src/ASM/ASMs3D.h +++ b/src/ASM/ASMs3D.h @@ -99,7 +99,7 @@ public: //! \brief Returns the spline volume representing this patch. Go::SplineVolume* getVolume() const { return svol; } //! \brief Returns the spline volume representing the basis of this patch. - virtual Go::SplineVolume* getBasis() const { return svol; } + virtual Go::SplineVolume* getBasis(int = 1) const { return svol; } // Methods for model generation diff --git a/src/ASM/ASMs3Dmx.h b/src/ASM/ASMs3Dmx.h index 67736b69..e9936010 100644 --- a/src/ASM/ASMs3Dmx.h +++ b/src/ASM/ASMs3Dmx.h @@ -43,7 +43,8 @@ public: virtual ~ASMs3Dmx() {} //! \brief Returns the spline volume representing the basis of this patch. - virtual Go::SplineVolume* getBasis() const { return basis1; } + virtual Go::SplineVolume* getBasis(int basis = 1) const + { return basis == 2 ? basis2 : basis1; } // Methods for model generation