本文整理汇总了C++中Space::shapeset方法的典型用法代码示例。如果您正苦于以下问题:C++ Space::shapeset方法的具体用法?C++ Space::shapeset怎么用?C++ Space::shapeset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Space
的用法示例。
在下文中一共展示了Space::shapeset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: maximumShapesetOrder
int maximumShapesetOrder(const Space<BasisFunctionType>& space)
{
const GridView& view = space.gridView();
int maxOrder = 0;
std::auto_ptr<EntityIterator<0> > it = view.entityIterator<0>();
while (!it->finished()) {
const Entity<0>& e = it->entity();
maxOrder = std::max(maxOrder, space.shapeset(e).order());
it->next();
}
return maxOrder;
}
示例2: getAllShapesets
void getAllShapesets(const Space<BasisFunctionType>& space,
std::vector<const Fiber::Shapeset<BasisFunctionType>*>& shapesets)
{
std::auto_ptr<GridView> view = space.grid()->leafView();
const Mapper& mapper = view->elementMapper();
const int elementCount = view->entityCount(0);
shapesets.resize(elementCount);
std::auto_ptr<EntityIterator<0> > it = view->entityIterator<0>();
while (!it->finished()) {
const Entity<0>& e = it->entity();
shapesets[mapper.entityIndex(e)] = &space.shapeset(e);
it->next();
}
}
示例3: invalid_argument
Matrix<ValueType> evaluateLocalBasis(const Space<double>& space, const Entity<0>& element,
const Matrix<double>& local, const Vector<ValueType>& localCoefficients)
{
if (local.rows() != space.grid()->dim())
throw std::invalid_argument("evaluate(): points in 'local' have an "
"invalid number of coordinates");
const int nComponents = space.codomainDimension();
Matrix<ValueType> values(nComponents, local.cols());
values.setZero();
// Find out which basis data need to be calculated
size_t basisDeps = 0, geomDeps = 0;
// Find out which geometrical data need to be calculated,
const Fiber::CollectionOfShapesetTransformations<double>
&transformations = space.basisFunctionValue();
transformations.addDependencies(basisDeps, geomDeps);
// Get basis data
const Fiber::Shapeset<double> &shapeset =
space.shapeset(element);
Fiber::BasisData<double> basisData;
shapeset.evaluate(basisDeps, local, ALL_DOFS, basisData);
// Get geometrical data
Fiber::GeometricalData<double> geomData;
element.geometry().getData(geomDeps, local, geomData);
// Get shape function values
Fiber::CollectionOf3dArrays<double> functionValues;
transformations.evaluate(basisData, geomData, functionValues);
// Calculate grid function values
for (size_t p = 0; p < functionValues[0].extent(2); ++p)
for (size_t f = 0; f < functionValues[0].extent(1); ++f)
for (size_t dim = 0; dim < functionValues[0].extent(0); ++dim)
values(dim, p) += functionValues[0](dim, f, p) * localCoefficients(f);
return values;
}