当前位置: 首页>>代码示例>>C++>>正文


C++ Space::grid方法代码示例

本文整理汇总了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());
}
开发者ID:getzze,项目名称:bempp,代码行数:34,代码来源:elementary_potential_operator.cpp

示例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;
}
开发者ID:bempp,项目名称:bempp,代码行数:9,代码来源:piecewise_linear_discontinuous_scalar_space.cpp

示例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();
    }
}
开发者ID:huidong80,项目名称:bempp,代码行数:16,代码来源:space.cpp

示例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;
}
开发者ID:pbena,项目名称:bempp,代码行数:40,代码来源:local_evaluator.hpp


注:本文中的Space::grid方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。