Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 23 additions & 4 deletions src/ASM/ASMmxBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
//==============================================================================

#include "ASMmxBase.h"
#include "Utilities.h"
#include "GoTools/geometry/SplineSurface.h"
#include "GoTools/geometry/SurfaceInterpolator.h"
#include "GoTools/trivariate/SplineVolume.h"
Expand Down Expand Up @@ -123,8 +124,8 @@ bool ASMmxBase::getSolutionMx (Matrix& sField, const Vector& locSol,
}


ASMmxBase::SurfaceVec ASMmxBase::establishBases(Go::SplineSurface* surf,
MixedType type)
ASMmxBase::SurfaceVec ASMmxBase::establishBases (Go::SplineSurface* surf,
MixedType type)
{
SurfaceVec result(2);
// With mixed methods we need two separate spline spaces
Expand Down Expand Up @@ -248,8 +249,8 @@ ASMmxBase::SurfaceVec ASMmxBase::establishBases(Go::SplineSurface* surf,
}


ASMmxBase::VolumeVec ASMmxBase::establishBases(Go::SplineVolume* svol,
MixedType type)
ASMmxBase::VolumeVec ASMmxBase::establishBases (Go::SplineVolume* svol,
MixedType type)
{
VolumeVec result(2);
// With mixed methods we need two separate spline spaces
Expand Down Expand Up @@ -498,3 +499,21 @@ Go::SplineVolume* ASMmxBase::raiseBasis (Go::SplineVolume* svol)
// Project the coordinates onto the new basis (the 2nd XYZ is dummy here)
return Go::VolumeInterpolator::regularInterpolation(basis[0],basis[1],basis[2],ug[0],ug[1],ug[2],XYZ,ndim,false,XYZ);
}


int ASMmxBase::maskDOFs (int dofs, char basis) const
{
unsigned char ofs = std::accumulate(nfx.begin(),nfx.begin()+basis-1,0u);
std::set<int> allDofs = utl::getDigits(dofs);
dofs = 0;

// Convert the DOF digits to local values of this basis,
// and mask off those not residing on this basis
for (int dof : allDofs)
{
dofs *= 10;
if (dof > ofs && dof <= ofs+nfx[basis-1])
dofs += dof - ofs;
}
return dofs;
}
12 changes: 10 additions & 2 deletions src/ASM/ASMmxBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,10 @@ class ASMmxBase
static char geoBasis; //!< 1-based index of basis representing the geometry

protected:
typedef std::vector<std::shared_ptr<Go::SplineSurface>> SurfaceVec; //!< Convenience type
typedef std::vector<std::shared_ptr<Go::SplineVolume>> VolumeVec; //!< Convenience type
typedef std::shared_ptr<Go::SplineSurface> SurfacePtr; //!< Pointer to spline
typedef std::shared_ptr<Go::SplineVolume> VolumePtr; //!< Pointer to spline
typedef std::vector<SurfacePtr> SurfaceVec; //!< Convenience type
typedef std::vector<VolumePtr> VolumeVec; //!< Convenience type

//! \brief Establish mixed bases in 2D.
//! \param[in] surf The base basis to use
Expand All @@ -94,6 +96,12 @@ class ASMmxBase
//! \brief Returns a C^p-1 basis of one degree higher than \a *svol.
static Go::SplineVolume* raiseBasis(Go::SplineVolume* svol);

//! \brief Mask off DOFs not residing on the specified basis
//! \param[in] dofs Encoded DOF indices (like 123456 meaning dofs 1 to 6)
//! \param[in] basis Which basis to return DOF indices for
//! \return Encoded DOF indices related to the specified basis only
int maskDOFs(int dofs, char basis) const;

private:
std::vector<int> MADOF; //!< Matrix of accumulated DOFs for this patch

Expand Down
Loading