本文整理汇总了C++中shards::CellTopology::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ CellTopology::getName方法的具体用法?C++ CellTopology::getName怎么用?C++ CellTopology::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类shards::CellTopology
的用法示例。
在下文中一共展示了CellTopology::getName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testSubcellParametrizations
void testSubcellParametrizations(int& errorFlag,
const shards::CellTopology& parentCell,
const FieldContainer<double>& subcParamVert_A,
const FieldContainer<double>& subcParamVert_B,
const int subcDim,
const Teuchos::RCP<std::ostream>& outStream){
// Get cell dimension and subcell count
int cellDim = parentCell.getDimension();
int subcCount = parentCell.getSubcellCount(subcDim);
// Loop over subcells of the specified dimension
for(int subcOrd = 0; subcOrd < subcCount; subcOrd++){
int subcVertexCount = parentCell.getVertexCount(subcDim, subcOrd);
// Storage for correct reference subcell vertices and for the images of the parametrization domain points
FieldContainer<double> refSubcellVertices(subcVertexCount, cellDim);
FieldContainer<double> mappedParamVertices(subcVertexCount, cellDim);
// Retrieve correct reference subcell vertices
CellTools<double>::getReferenceSubcellVertices(refSubcellVertices, subcDim, subcOrd, parentCell);
// Map vertices of the parametrization domain to 1 or 2-subcell with ordinal subcOrd
// For edges parametrization domain is always 1-cube passed as "subcParamVert_A"
if(subcDim == 1) {
CellTools<double>::mapToReferenceSubcell(mappedParamVertices,
subcParamVert_A,
subcDim,
subcOrd,
parentCell);
}
// For faces need to treat Triangle and Quadrilateral faces separately
else if(subcDim == 2) {
// domain "subcParamVert_A" is the standard 2-simplex
if(subcVertexCount == 3){
CellTools<double>::mapToReferenceSubcell(mappedParamVertices,
subcParamVert_A,
subcDim,
subcOrd,
parentCell);
}
// Domain "subcParamVert_B" is the standard 2-cube
else if(subcVertexCount == 4){
CellTools<double>::mapToReferenceSubcell(mappedParamVertices,
subcParamVert_B,
subcDim,
subcOrd,
parentCell);
}
}
// Compare the images of the parametrization domain vertices with the true vertices.
for(int subcVertOrd = 0; subcVertOrd < subcVertexCount; subcVertOrd++){
for(int dim = 0; dim < cellDim; dim++){
if(mappedParamVertices(subcVertOrd, dim) != refSubcellVertices(subcVertOrd, dim) ) {
errorFlag++;
*outStream
<< std::setw(70) << "^^^^----FAILURE!" << "\n"
<< " Cell Topology = " << parentCell.getName() << "\n"
<< " Parametrization of subcell " << subcOrd << " which is "
<< parentCell.getName(subcDim,subcOrd) << " failed for vertex " << subcVertOrd << ":\n"
<< " parametrization map fails to map correctly coordinate " << dim << " of that vertex\n\n";
}//if
}// for dim
}// for subcVertOrd
}// for subcOrd
}