本文整理汇总了C++中Obj::depthStratum方法的典型用法代码示例。如果您正苦于以下问题:C++ Obj::depthStratum方法的具体用法?C++ Obj::depthStratum怎么用?C++ Obj::depthStratum使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Obj
的用法示例。
在下文中一共展示了Obj::depthStratum方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CreateMesh
PetscErrorCode CreateMesh(MPI_Comm comm, Obj<ALE::Mesh>& mesh, Options *options)
{
PetscErrorCode ierr;
PetscFunctionBegin;
ALE::LogStage stage = ALE::LogStageRegister("MeshCreation");
ALE::LogStagePush(stage);
ierr = PetscPrintf(comm, "Creating mesh\n");CHKERRQ(ierr);
mesh = ALE::PCICE::Builder::readMesh(comm, 2, options->baseFilename, options->useZeroBase, true, options->debug);
ALE::Coarsener::IdentifyBoundary(mesh, 2);
ALE::Coarsener::make_coarsest_boundary(mesh, 2, options->levels + 1);
ALE::LogStagePop(stage);
Obj<ALE::Mesh::topology_type> topology = mesh->getTopology();
ierr = PetscPrintf(comm, " Read %d elements\n", topology->heightStratum(0, 0)->size());CHKERRQ(ierr);
ierr = PetscPrintf(comm, " Read %d vertices\n", topology->depthStratum(0, 0)->size());CHKERRQ(ierr);
if (options->debug) {
topology->view("Serial topology");
}
PetscFunctionReturn(0);
}
示例2: CreateMesh
PetscErrorCode CreateMesh(MPI_Comm comm, Obj<ALE::Mesh>& mesh, Options *options)
{
ALE::Obj<ALE::Mesh> mesh2;
PetscErrorCode ierr;
PetscFunctionBegin;
ALE::LogStage stage = ALE::LogStageRegister("MeshCreation");
ALE::LogStagePush(stage);
ierr = PetscPrintf(comm, "Creating mesh\n");CHKERRQ(ierr);
if (options->generate) {
if (options->dim == 3) {
double lower[3] = {0.0, 0.0, 0.0};
double upper[3] = {1.0, 1.0, 1.0};
double offset[3] = {0.5, 0.5, 0.5};
ALE::Obj<ALE::Mesh> mb = ALE::MeshBuilder::createFicheraCornerBoundary(comm, lower, upper, offset);
mesh2 = ALE::Generator::refineMesh(ALE::Generator::generateMesh(mb, options->interpolate), options->refinementLimit, options->interpolate);
ierr = MeshRefineSingularity_Fichera(mesh2, comm, offset, 0.75, &mesh);CHKERRQ(ierr);
} else if (options->dim == 2) {
double lower[2] = {0.0, 0.0};
double upper[2] = {1.0, 1.0};
double offset[2] = {0.0, 0.0};
//ALE::Obj<ALE::Mesh> mb = ALE::MeshBuilder::createReentrantBoundary(comm, lower, upper, offset);
ALE::Obj<ALE::Mesh> mb = ALE::MeshBuilder::createCircularReentrantBoundary(comm, 100, 1.0, 0.9);
mesh2 = ALE::Generator::refineMesh(ALE::Generator::generateMesh(mb, options->interpolate), options->refinementLimit, options->interpolate);
ierr = MeshRefineSingularity_Fichera(mesh2, comm, offset, 0.9, &mesh, PETSC_TRUE);CHKERRQ(ierr);
//mesh = ALE::Generator::generateMesh(mb, options->debug);
}
} else {
mesh = ALE::PCICE::Builder::readMesh(comm, options->dim, options->baseFilename, options->useZeroBase, options->interpolate, options->debug);
}
//ALE::Coarsener::IdentifyBoundary(mesh, 2);
//ALE::Coarsener::make_coarsest_boundary(mesh, 2, options->levels + 1);
ALE::LogStagePop(stage);
ierr = PetscPrintf(comm, " Read %d elements\n", mesh->heightStratum(0)->size());CHKERRQ(ierr);
ierr = PetscPrintf(comm, " Read %d edges/faces\n", mesh->heightStratum(1)->size());CHKERRQ(ierr);
ierr = PetscPrintf(comm, " Read %d vertices\n", mesh->depthStratum(0)->size());CHKERRQ(ierr);
if (options->debug) {
// topology->view("Serial topology");
}
PetscFunctionReturn(0);
}