本文整理汇总了C++中Space::grid方法的典型用法代码示例。如果您正苦于以下问题:C++ Space::grid方法的具体用法?C++ Space::grid怎么用?C++ Space::grid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Space
的用法示例。
在下文中一共展示了Space::grid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
bool
PiecewiseLinearDiscontinuousVectorSpace<BasisFunctionType, codomainDim>::spaceIsCompatible(
const Space<BasisFunctionType>& other) const
{
return other.grid().get() == this->grid().get() &&
other.spaceIdentifier() == this->spaceIdentifier();
}
开发者ID:wsmigaj,项目名称:bempp-simple-vector-spaces,代码行数:7,代码来源:piecewise_linear_discontinuous_vector_space.cpp
示例2: makeAssembler
std::unique_ptr<typename ElementaryPotentialOperator<
BasisFunctionType, KernelType, ResultType>::LocalAssembler>
ElementaryPotentialOperator<BasisFunctionType, KernelType, ResultType>::
makeAssembler(const Space<BasisFunctionType> &space,
const arma::Mat<CoordinateType> &evaluationPoints,
const QuadratureStrategy &quadStrategy,
const EvaluationOptions &options) const {
// Collect the standard set of data necessary for construction of
// assemblers
typedef Fiber::RawGridGeometry<CoordinateType> RawGridGeometry;
typedef std::vector<const Fiber::Shapeset<BasisFunctionType> *>
ShapesetPtrVector;
typedef std::vector<std::vector<ResultType>> CoefficientsVector;
typedef LocalAssemblerConstructionHelper Helper;
shared_ptr<RawGridGeometry> rawGeometry;
shared_ptr<GeometryFactory> geometryFactory;
shared_ptr<Fiber::OpenClHandler> openClHandler;
shared_ptr<ShapesetPtrVector> shapesets;
shared_ptr<const Grid> grid = space.grid();
Helper::collectGridData(space, rawGeometry, geometryFactory);
Helper::makeOpenClHandler(options.parallelizationOptions().openClOptions(),
rawGeometry, openClHandler);
Helper::collectShapesets(space, shapesets);
// Now create the assembler
return quadStrategy.makeAssemblerForPotentialOperators(
evaluationPoints, geometryFactory, rawGeometry, shapesets,
make_shared_from_ref(kernels()),
make_shared_from_ref(trialTransformations()),
make_shared_from_ref(integral()), openClHandler,
options.parallelizationOptions(), options.verbosityLevel());
}
示例3: return
bool PiecewiseLinearDiscontinuousScalarSpace<
BasisFunctionType>::spaceIsCompatible(const Space<BasisFunctionType> &other)
const {
if (other.grid().get() == this->grid().get()) {
return (other.spaceIdentifier() == this->spaceIdentifier());
} else
return false;
}
示例4: 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();
}
}
示例5: 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;
}