本文整理汇总了C++中Vectors::size方法的典型用法代码示例。如果您正苦于以下问题:C++ Vectors::size方法的具体用法?C++ Vectors::size怎么用?C++ Vectors::size使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vectors
的用法示例。
在下文中一共展示了Vectors::size方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ClearVectors
void __stdcall ClearVectors()
{
for (Vectors::size_type i = 0; i < vectors.size(); ++i)
delete[] vectors[i];
vectors.clear();
}
示例2: refine
bool ASMunstruct::refine (const LR::RefineData& prm,
Vectors& sol, const char* fName)
{
PROFILE2("ASMunstruct::refine()");
if (!geo)
return false;
else if (shareFE && !prm.refShare)
{
nnod = geo->nBasisFunctions();
return true;
}
// to pick up if LR splines get stuck while doing refinement,
// print entry and exit point of this function
double beta = prm.options.size() > 0 ? prm.options[0]/100.0 : 0.10;
int multiplicity = prm.options.size() > 1 ? prm.options[1] : 1;
if (multiplicity > 1)
for (int d = 0; d < geo->nVariate(); d++) {
int p = geo->order(d) - 1;
if (multiplicity > p) multiplicity = p;
}
enum refinementStrategy strat = LR_FULLSPAN;
if (prm.options.size() > 2)
switch (prm.options[2]) {
case 1: strat = LR_MINSPAN; break;
case 2: strat = LR_STRUCTURED_MESH; break;
}
bool linIndepTest = prm.options.size() > 3 ? prm.options[3] != 0 : false;
int maxTjoints = prm.options.size() > 4 ? prm.options[4] : -1;
int maxAspectRatio = prm.options.size() > 5 ? prm.options[5] : -1;
bool closeGaps = prm.options.size() > 6 ? prm.options[6] != 0 : false;
char doRefine = 0;
if (!prm.errors.empty())
doRefine = 'E'; // Refine based on error indicators
else if (!prm.elements.empty())
doRefine = 'I'; // Refine the specified elements
if (doRefine) {
std::vector<int> nf(sol.size());
for (size_t j = 0; j < sol.size(); j++)
if (!(nf[j] = LR::extendControlPoints(geo,sol[j],this->getNoFields(1))))
return false;
// set refinement parameters
if (maxTjoints > 0)
geo->setMaxTjoints(maxTjoints);
if (maxAspectRatio > 0)
geo->setMaxAspectRatio((double)maxAspectRatio);
geo->setCloseGaps(closeGaps);
geo->setRefMultiplicity(multiplicity);
geo->setRefStrat(strat);
// do actual refinement
if (doRefine == 'E')
geo->refineByDimensionIncrease(prm.errors,beta);
else if (strat == LR_STRUCTURED_MESH)
geo->refineBasisFunction(prm.elements);
else
geo->refineElement(prm.elements);
geo->generateIDs();
nnod = geo->nBasisFunctions();
for (int i = sol.size()-1; i >= 0; i--) {
sol[i].resize(nf[i]*geo->nBasisFunctions());
LR::contractControlPoints(geo,sol[i],nf[i]);
}
}
if (fName)
{
char fullFileName[256];
strcpy(fullFileName, "lrspline_");
strcat(fullFileName, fName);
std::ofstream lrOut(fullFileName);
lrOut << *geo;
lrOut.close();
LR::LRSplineSurface* lr = dynamic_cast<LR::LRSplineSurface*>(geo);
if (lr) {
// open files for writing
strcpy(fullFileName, "param_");
strcat(fullFileName, fName);
std::ofstream paramMeshFile(fullFileName);
strcpy(fullFileName, "physical_");
strcat(fullFileName, fName);
std::ofstream physicalMeshFile(fullFileName);
strcpy(fullFileName, "param_dot_");
strcat(fullFileName, fName);
std::ofstream paramDotMeshFile(fullFileName);
//.........这里部分代码省略.........