changed: remove ASMxxD::get(Surface|Volume)

use getBasis instead
This commit is contained in:
Arne Morten Kvarving
2023-08-23 15:01:14 +02:00
parent 957af79433
commit 3d6d950474
15 changed files with 32 additions and 37 deletions

View File

@@ -340,7 +340,7 @@ bool MultiPatchModelGenerator2D::createGeometry (SIMinput& sim) const
}
// Compute parameters
const Go::SplineSurface* srf = pch.getSurface();
const Go::SplineSurface* srf = pch.getBasis(ASM::GEOMETRY_BASIS);
size_t px = srf->order_u()-1;
size_t py = srf->order_v()-1;
size_t nelemsx = srf->numCoefs_u() - px;
@@ -650,7 +650,7 @@ bool MultiPatchModelGenerator3D::createGeometry (SIMinput& sim) const
}
// Compute parameters
const Go::SplineVolume* vol = pch.getVolume();
const Go::SplineVolume* vol = pch.getBasis(ASM::GEOMETRY_BASIS);
size_t px = vol->order(0)-1;
size_t py = vol->order(1)-1;
size_t pz = vol->order(2)-1;

View File

@@ -187,8 +187,6 @@ public:
//! \brief The destructor frees the dynamically allocated boundary curves.
virtual ~ASMs2D();
//! \brief Returns the spline surface representing the geometry of this patch.
Go::SplineSurface* getSurface() const { return surf; }
//! \brief Returns the spline curve representing a boundary of this patch.
//! \param[in] dir Parameter direction defining which boundary to return
virtual Go::SplineCurve* getBoundary(int dir, int = 1);

View File

@@ -206,8 +206,6 @@ public:
//! \brief Empty destructor.
virtual ~ASMs3D() {}
//! \brief Returns the spline volume representing the geometry of this patch.
Go::SplineVolume* getVolume() const { return svol; }
//! \brief Returns the spline surface representing a boundary of this patch.
//! \param[in] dir Parameter direction defining which boundary to return
virtual Go::SplineSurface* getBoundary(int dir, int = 1);

View File

@@ -133,11 +133,6 @@ public:
//! \brief Empty destructor.
virtual ~ASMu2D() { geomB = nullptr; }
//! \brief Returns the spline surface representing the geometry of this patch.
LR::LRSplineSurface* getSurface() { return this->createLRfromTensor().get(); }
//! \brief Returns the spline surface representing the geometry of this patch.
const LR::LRSplineSurface* getSurface() const { return lrspline.get(); }
//! \brief Returns the spline surface representing a basis of this patch.
virtual const LR::LRSplineSurface* getBasis(int basis = 1) const;
//! \brief Returns the spline surface representing a basis of this patch.

View File

@@ -116,11 +116,6 @@ public:
//! \brief Empty destructor.
virtual ~ASMu3D() {}
//! \brief Returns the spline volume representing the geometry of this patch.
LR::LRSplineVolume* getVolume() { return this->createLRfromTensor().get(); }
//! \brief Returns the spline volume representing the geometry of this patch.
const LR::LRSplineVolume* getVolume() const { return lrspline.get(); }
//! \brief Returns the spline volume representing a basis of this patch.
virtual const LR::LRSplineVolume* getBasis(int basis = 1) const;
//! \brief Returns the spline volume representing a basis of this patch.

View File

@@ -26,7 +26,7 @@ LRSplineField2D::LRSplineField2D (const ASMu2D* patch,
char cmp, const char* name)
: FieldBase(name),
basis(patch->getBasis(nbasis)),
surf(patch->getSurface()),
surf(patch->getBasis(ASM::GEOMETRY_BASIS)),
is_rational(patch->rational())
{
nno = basis->nBasisFunctions();

View File

@@ -18,14 +18,15 @@
#include "ASMu3D.h"
#include "ItgPoint.h"
#include "SplineUtils.h"
#include "Vec3.h"
LRSplineField3D::LRSplineField3D (const ASMu3D* patch,
const RealArray& v, char nbasis,
char cmp, const char* name)
: FieldBase(name), basis(patch->getBasis(nbasis)), vol(patch->getVolume())
: FieldBase(name),
basis(patch->getBasis(nbasis)),
vol(patch->getBasis(ASM::GEOMETRY_BASIS))
{
nno = basis->nBasisFunctions();
nelm = basis->nElements();

View File

@@ -26,7 +26,7 @@ LRSplineFields2D::LRSplineFields2D (const ASMu2D* patch,
int nnf, const char* name)
: Fields(name),
basis(patch->getBasis(nbasis)),
surf(patch->getSurface()),
surf(patch->getBasis(ASM::GEOMETRY_BASIS)),
is_rational(patch->rational())
{
nno = basis->nBasisFunctions();

View File

@@ -18,14 +18,15 @@
#include "ASMu3D.h"
#include "ItgPoint.h"
#include "SplineUtils.h"
#include "Vec3.h"
LRSplineFields3D::LRSplineFields3D (const ASMu3D* patch,
const RealArray& v, char nbasis,
int nnf, const char* name)
: Fields(name), basis(patch->getBasis(nbasis)), vol(patch->getVolume())
: Fields(name),
basis(patch->getBasis(nbasis)),
vol(patch->getBasis(ASM::GEOMETRY_BASIS))
{
nno = basis->nBasisFunctions();
nelm = basis->nElements();

View File

@@ -107,7 +107,7 @@ TEST(TestASMu2D, InterfaceChecker)
pch->raiseOrder(1,1);
pch->uniformRefine(0, 3);
pch->uniformRefine(1, 3);
LR::LRSplineSurface* lr = pch->getSurface();
LR::LRSplineSurface* lr = pch->getBasis();
lr->insert_const_u_edge(0.5, 0, 1, 2);
lr->insert_const_v_edge(0.125, 0.5, 1, 2);
lr->insert_const_v_edge(0.25, 0.5, 1, 2);
@@ -190,7 +190,7 @@ TEST(TestASMu2D, TransferGaussPtVars)
sim.opt.discretization = ASM::LRSpline;
ASMu2D* pch = static_cast<ASMu2D*>(sim.createDefaultModel());
LR::LRSplineSurface* lr = pch->getSurface();
LR::LRSplineSurface* lr = pch->getBasis(1);
lr->generateIDs();
RealArray oldAr(9), newAr;
@@ -201,7 +201,7 @@ TEST(TestASMu2D, TransferGaussPtVars)
simNew.opt.discretization = ASM::LRSpline;
ASMu2D* pchNew = static_cast<ASMu2D*>(simNew.createDefaultModel());
pchNew->uniformRefine(idx, 1);
LR::LRSplineSurface* lrNew = pchNew->getSurface();
LR::LRSplineSurface* lrNew = pchNew->getBasis(1);
ASSERT_TRUE(lrNew != nullptr);
lrNew->generateIDs();
for (id[1] = 0; id[1] < 3; ++id[1])
@@ -223,12 +223,12 @@ TEST(TestASMu2D, TransferGaussPtVarsN)
sim.opt.discretization = sim2.opt.discretization = ASM::LRSpline;
ASMu2D* pch = static_cast<ASMu2D*>(sim.createDefaultModel());
LR::LRSplineSurface* lr = pch->getSurface();
LR::LRSplineSurface* lr = pch->getBasis(1);
lr->generateIDs();
ASMu2D* pchNew = static_cast<ASMu2D*>(sim2.createDefaultModel());
pchNew->uniformRefine(0, 1);
LR::LRSplineSurface* lrNew = pchNew->getSurface();
LR::LRSplineSurface* lrNew = pchNew->getBasis(1);
ASSERT_TRUE(lrNew != nullptr);
lrNew->generateIDs();
@@ -281,7 +281,7 @@ TEST(TestASMu2D, ElementConnectivities)
ASSERT_TRUE(pch1.uniformRefine(0,1));
ASSERT_TRUE(pch1.uniformRefine(1,1));
ASSERT_TRUE(pch1.generateFEMTopology());
pch1.getSurface()->generateIDs();
pch1.getBasis(1)->generateIDs();
IntMat neigh(4);
pch1.getElmConnectivities(neigh);
const std::array<std::vector<int>,4> ref = {{{1, 2},

View File

@@ -110,7 +110,7 @@ public:
TEST(TestASMu3D, TransferGaussPtVars)
{
ASMuCube pch;
LR::LRSplineVolume* lr = pch.getVolume();
LR::LRSplineVolume* lr = pch.getBasis(1);
ASSERT_TRUE(lr != nullptr);
lr->generateIDs();
@@ -120,7 +120,7 @@ TEST(TestASMu3D, TransferGaussPtVars)
for (size_t idx = 0; idx < 3; ++idx) {
ASMuCube pchNew;
pchNew.uniformRefine(idx,1);
pchNew.getVolume()->generateIDs();
pchNew.getBasis(1)->generateIDs();
for (id[2] = 0; id[2] < 3; ++id[2])
for (id[1] = 0; id[1] < 3; ++id[1])
for (id[0] = 0; id[0] < 3; ++id[0])
@@ -139,12 +139,12 @@ TEST(TestASMu3D, TransferGaussPtVars)
TEST(TestASMu3D, TransferGaussPtVarsN)
{
ASMuCube pch, pchNew;
LR::LRSplineVolume* lr = pch.getVolume();
LR::LRSplineVolume* lr = pch.getBasis(1);
ASSERT_TRUE(lr != nullptr);
lr->generateIDs();
pchNew.uniformRefine(0,1);
pchNew.getVolume()->generateIDs();
pchNew.getBasis(1)->generateIDs();
RealArray oldAr(3*3*3), newAr;
std::iota(oldAr.begin(), oldAr.end(), 1);

View File

@@ -28,7 +28,9 @@
SplineField2D::SplineField2D (const ASMs2D* patch,
const RealArray& v, char nbasis,
char cmp, const char* name)
: FieldBase(name), basis(patch->getBasis(nbasis)), surf(patch->getSurface())
: FieldBase(name),
basis(patch->getBasis(nbasis)),
surf(patch->getBasis(ASM::GEOMETRY_BASIS))
{
const int n1 = basis->numCoefs_u();
const int n2 = basis->numCoefs_v();

View File

@@ -28,7 +28,9 @@
SplineField3D::SplineField3D (const ASMs3D* patch,
const RealArray& v, char nbasis,
char cmp, const char* name)
: FieldBase(name), basis(patch->getBasis(nbasis)), vol(patch->getVolume())
: FieldBase(name),
basis(patch->getBasis(nbasis)),
vol(patch->getBasis(ASM::GEOMETRY_BASIS))
{
const int n1 = basis->numCoefs(0);
const int n2 = basis->numCoefs(1);

View File

@@ -18,7 +18,6 @@
#include "ASMs2D.h"
#include "ItgPoint.h"
#include "SplineUtils.h"
#include "Utilities.h"
#include "Vec3.h"
@@ -26,7 +25,9 @@
SplineFields2D::SplineFields2D (const ASMs2D* patch,
const RealArray& v, char nbasis,
int nnf, const char* name)
: Fields(name), basis(patch->getBasis(nbasis)), surf(patch->getSurface())
: Fields(name),
basis(patch->getBasis(nbasis)),
surf(patch->getBasis(ASM::GEOMETRY_BASIS))
{
const int n1 = basis->numCoefs_u();
const int n2 = basis->numCoefs_v();

View File

@@ -26,7 +26,9 @@
SplineFields3D::SplineFields3D (const ASMs3D* patch,
const RealArray& v, char nbasis,
int nnf, const char* name)
: Fields(name), basis(patch->getBasis(nbasis)), vol(patch->getVolume())
: Fields(name),
basis(patch->getBasis(nbasis)),
vol(patch->getBasis(ASM::GEOMETRY_BASIS))
{
const int n1 = basis->numCoefs(0);
const int n2 = basis->numCoefs(1);