55 const Real quA = options.
getReal(
"quA");
58 return get<T>(qu, nnodes);
63 static typename gsQuadRule<T>::uPtr
68 const Real quA = options.
getReal(
"quA");
70 const bool over = options.
askSwitch (
"overInt",
false);
83 GISMO_ERROR(
"Invalid Quadrature rule request ("<<qu<<
")");
92 const Real quAb = options.
askReal(
"quAb",quA+1);
98 std::vector<gsQuadRule<T> > quInterior(nnodesI.size());
99 std::vector<gsQuadRule<T> > quBoundary(nnodesB.size());
101 for (
index_t d = 0; d != nnodesI.size(); d++)
103 quInterior[d] = getUnivariate<T>(qu,nnodesI[d]);
104 quBoundary[d] = getUnivariate<T>(qu,nnodesB[d]);
118 GISMO_ERROR(
"Quadrature with index "<<qu<<
" unknown.");
133 GISMO_ERROR(
"Invalid Quadrature rule request ("<<qu<<
")");
148 GISMO_ERROR(
"Invalid Quadrature rule request ("<<qu<<
")");
159 GISMO_ASSERT( fixDir < d && fixDir>-2,
"Invalid input fixDir = "<<fixDir);
168 for(i=0; i!=fixDir; ++i )
170 nnodes[i] = cast<Real,index_t>(quA * basis.degree(i) + quB + 0.5);
172 nnodes[i] = cast<Real,index_t>(quA * basis.degree(i) + quB + 0.5);
198 typename gsBasis<real_t>::domainIter domIt = basis.makeDomainIterator();
201 typename gsQuadRule<T>::uPtr QuRule;
202 QuRule =
getPtr(basis, options);
204 for (; domIt->good(); domIt->next())
215 for (domIt->reset(); domIt->good(); domIt->next() )
219 QuRule->
mapTo( domIt->lowerCorner(), domIt->upperCorner(),
221 result.block(0,offset,basis.domainDim(),QuRule->
numNodes()) = nodes;
241 typename gsBasis<real_t>::domainIter domIt = basis.makeDomainIterator(side);
244 typename gsQuadRule<T>::uPtr QuRule;
245 QuRule =
getPtr(basis, options,side.side().direction());
247 for (; domIt->good(); domIt->next())
258 for (domIt->reset(); domIt->good(); domIt->next() )
262 QuRule->
mapTo( domIt->lowerCorner(), domIt->upperCorner(),
264 result.block(0,offset,basis.domainDim(),QuRule->
numNodes()) = nodes;
278 return geom.
eval(nodes);
286 const gsOptionList & options,
const std::vector<patchSide> sides)
288 std::vector<gsMatrix<T>> nodes(sides.size());
290 for (
size_t s = 0; s != sides.size(); s++)
293 cols += nodes[s].cols();
298 for (
size_t s = 0; s != sides.size(); s++)
300 result.block(0,cols,nodes[s].rows(),nodes[s].cols()) = nodes[s];
301 cols += nodes[s].cols();
312 const gsOptionList & options,
const std::vector<patchSide> sides)
315 return geom.
eval(nodes);
330 const gsOptionList & options,
const std::vector<patchSide> sides)
332 GISMO_ASSERT(bases.
nBases()==sides.size(),
"Number of bases must be equal to the number of fixed directions");
333 std::vector<gsMatrix<T>> nodes(bases.
nBases());
334 for (
size_t p = 0; p != bases.
nBases(); p++)
354 const gsOptionList & options,
const std::vector<patchSide> sides)
356 std::vector<gsMatrix<T>> nodes =
getAllNodes(bases,options,sides);
358 for (
size_t p = 0; p != nodes.size(); p++)
359 cols += nodes[p].cols();
363 for (
size_t p = 0; p != nodes.size(); p++)
365 result.block(0,cols,mp.targetDim(),nodes[p].cols()) = mp.patch(p).eval(nodes[p]);
366 cols += nodes[p].cols();
A basis represents a family of scalar basis functions defined over a common parameter domain.
Definition gsBasis.h:79
gsMatrix< T > eval(const gsMatrix< T > &u) const
Evaluate the function,.
Definition gsFunctionSet.hpp:120
Class that represents the (tensor) Gauss-Legendre quadrature rule.
Definition gsGaussRule.h:28
static uPtr make(gsVector< index_t > const &numNodes, const unsigned digits=0)
Make function returning a smart pointer.
Definition gsGaussRule.h:44
Abstract base class representing a geometry map.
Definition gsGeometry.h:93
Class that represents the (tensor) Gauss-Lobatto quadrature rule.
Definition gsLobattoRule.h:27
static uPtr make(gsVector< index_t > const &numNodes, const unsigned digits=0)
Make function returning a smart pointer.
Definition gsLobattoRule.h:43
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
Holds a set of patch-wise bases and their topology information.
Definition gsMultiBasis.h:37
const gsBasis< T > & basis(const size_t i) const
Return the i-th basis block.
Definition gsMultiBasis.h:267
size_t nBases() const
Number of patch-wise bases.
Definition gsMultiBasis.h:264
Container class for a set of geometry patches and their topology, that is, the interface connections ...
Definition gsMultiPatch.h:100
Class which holds a list of parameters/options, and provides easy access to them.
Definition gsOptionList.h:33
Real askReal(const std::string &label, const Real &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:139
bool askSwitch(const std::string &label, const bool &value=false) const
Reads value for option label from options.
Definition gsOptionList.cpp:128
const index_t & getInt(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:37
Real getReal(const std::string &label) const
Reads value for option label from options.
Definition gsOptionList.cpp:44
index_t askInt(const std::string &label, const index_t &value=0) const
Reads value for option label from options.
Definition gsOptionList.cpp:117
static uPtr make(const gsBasis< T > &basis, const std::vector< gsQuadRule< T > > &quadInterior, const std::vector< gsQuadRule< T > > &quadBoundary)
Construct a smart-pointer to the rule.
Definition gsOverIntegrateRule.h:75
static uPtr make(const gsBasis< T > &basis, const index_t degree, const index_t regularity, const bool overintegrate, const short_t fixDir=-1)
Make function returning a smart pointer.
Definition gsPatchRule.h:126
Class representing a reference quadrature rule.
Definition gsQuadRule.h:29
index_t numNodes() const
Number of nodes in the currently kept rule.
Definition gsQuadRule.h:106
virtual void mapTo(const gsVector< T > &lower, const gsVector< T > &upper, gsMatrix< T > &nodes, gsVector< T > &weights) const
Maps quadrature rule (i.e., points and weights) from the reference domain to an element.
Definition gsQuadRule.h:177
A vector with arbitrary coefficient type and fixed or dynamic size.
Definition gsVector.h:37
#define short_t
Definition gsConfig.h:35
#define GISMO_COEFF_TYPE
Definition gsConfig.h:26
#define index_t
Definition gsConfig.h:32
#define GISMO_ERROR(message)
Definition gsDebug.h:118
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
Provides declaration of DomainIterator abstract interface.
Provides the Gauss-Legendre quadrature rule.
Provides the Gauss-Lobatto quadrature rule.
Provides the Newton-Cotes quadrature rule.
Provides a list of labeled parameters/options that can be set and accessed easily.
Over-integrates a Gauss-Legendre or Gauss-Lobatto rule.
Provides patch-wise quadrature rule.
The G+Smo namespace, containing all definitions for the library.
Helper class for obtaining a quadrature rule.
Definition gsQuadrature.h:31
static gsMatrix< T > getAllNodes(const gsBasis< T > &basis, const gsOptionList &options, const patchSide side)
Get all quadrature nodes for a specified side of a given basis.
Definition gsQuadrature.h:238
static gsQuadRule< T > getUnivariate(index_t qu, index_t numNodes, unsigned digits=0)
Constructs a quadrature rule based on input options.
Definition gsQuadrature.h:139
static gsMatrix< T > getAllNodes(const gsBasis< T > &basis, const gsGeometry< T > &geom, const gsOptionList &options, const patchSide side)
Get all quadrature nodes for a specified side of a basis and evaluates them using a geometry.
Definition gsQuadrature.h:274
static gsMatrix< T > getAllNodes(const gsBasis< T > &basis, const gsOptionList &options, const std::vector< patchSide > sides)
Retrieves all quadrature nodes for multiple sides of a given basis.
Definition gsQuadrature.h:285
static gsMatrix< T > getAllNodes(const gsMultiBasis< T > &bases, const gsMultiPatch< T > &mp, const gsOptionList &options, const std::vector< patchSide > sides)
Gets all quadrature nodes for several sides of a multi-basis for multi-patch geometry.
Definition gsQuadrature.h:353
static gsQuadRule< T > get(const gsBasis< T > &basis, const gsOptionList &options, short_t fixDir=-1)
Constructs a quadrature rule based on input options.
Definition gsQuadrature.h:51
rule
Quadrature rule types.
Definition gsQuadrature.h:36
@ PatchRule
Patch-wise quadrature rule (Johannessen 2017)
Definition gsQuadrature.h:39
@ GaussLegendre
Gauss-Legendre quadrature.
Definition gsQuadrature.h:37
@ GaussLobatto
Gauss-Lobatto quadrature.
Definition gsQuadrature.h:38
static gsVector< index_t > numNodes(const gsBasis< T > &basis, const Real quA, const index_t quB, short_t fixDir=-1)
Definition gsQuadrature.h:155
static gsMatrix< T > getAllNodes(const gsBasis< T > &basis, const gsOptionList &options)
Retrieves all quadrature nodes for the given basis.
Definition gsQuadrature.h:195
static gsQuadRule< T >::uPtr getPtr(const gsBasis< T > &basis, const gsOptionList &options, short_t fixDir=-1)
Constructs a quadrature rule based on input options.
Definition gsQuadrature.h:64
static std::vector< gsMatrix< T > > getAllNodes(const gsMultiBasis< T > &bases, const gsOptionList &options, const std::vector< patchSide > sides)
Collects all quadrature nodes for a multi-basis.
Definition gsQuadrature.h:329
static gsMatrix< T > getAllNodes(const gsBasis< T > &basis, const gsGeometry< T > &geom, const gsOptionList &options, const std::vector< patchSide > sides)
Collects and evaluates all quadrature nodes for multiple sides of a given basis.
Definition gsQuadrature.h:311
static gsQuadRule< T > get(index_t qu, gsVector< index_t > const &numNodes, unsigned digits=0)
Constructs a quadrature rule based on input options.
Definition gsQuadrature.h:124
Struct which represents a certain side of a patch.
Definition gsBoundary.h:232