本文整理汇总了C++中EngngModel::giveOutputBaseFileName方法的典型用法代码示例。如果您正苦于以下问题:C++ EngngModel::giveOutputBaseFileName方法的具体用法?C++ EngngModel::giveOutputBaseFileName怎么用?C++ EngngModel::giveOutputBaseFileName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EngngModel
的用法示例。
在下文中一共展示了EngngModel::giveOutputBaseFileName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drMicro
void
SolutionbasedShapeFunction :: loadProblem()
{
for ( int i = 0; i < this->domain->giveNumberOfSpatialDimensions(); i++ ) {
OOFEM_LOG_INFO("************************** Instanciating microproblem from file %s for dimension %u\n", filename.c_str(), i);
// Set up and solve problem
OOFEMTXTDataReader drMicro( filename.c_str() );
EngngModel *myEngngModel = InstanciateProblem(& drMicro, _processor, 0, NULL, false);
drMicro.finish();
myEngngModel->checkProblemConsistency();
myEngngModel->initMetaStepAttributes( myEngngModel->giveMetaStep(1) );
thisTimestep = myEngngModel->giveNextStep();
myEngngModel->init();
this->setLoads(myEngngModel, i + 1);
// Check
for ( int j = 1; j <= myEngngModel->giveDomain(1)->giveNumberOfElements(); j++ ) {
Element *e = myEngngModel->giveDomain(1)->giveElement(j);
FloatArray centerCoord;
int vlockCount = 0;
centerCoord.resize(3);
centerCoord.zero();
for ( int k = 1; k <= e->giveNumberOfDofManagers(); k++ ) {
DofManager *dman = e->giveDofManager(k);
centerCoord.add( * dman->giveCoordinates() );
for ( Dof *dof: *dman ) {
if ( dof->giveBcId() != 0 ) {
vlockCount++;
}
}
}
if ( vlockCount == 30 ) {
OOFEM_WARNING("Element over-constrained (%u)! Center coordinate: %f, %f, %f\n", e->giveNumber(), centerCoord.at(1) / 10, centerCoord.at(2) / 10, centerCoord.at(3) / 10);
}
}
myEngngModel->solveYourselfAt(thisTimestep);
isLoaded = true;
// Set correct export filename
std :: string originalFilename;
originalFilename = myEngngModel->giveOutputBaseFileName();
if ( i == 0 ) {
originalFilename = originalFilename + "_X";
}
if ( i == 1 ) {
originalFilename = originalFilename + "_Y";
}
if ( i == 2 ) {
originalFilename = originalFilename + "_Z";
}
myEngngModel->letOutputBaseFileNameBe(originalFilename + "_1_Base");
myEngngModel->doStepOutput(thisTimestep);
modeStruct *mode = new(modeStruct);
mode->myEngngModel = myEngngModel;
// Check elements
// Set unknowns to the mean value of opposite sides of the domain.
// Loop thru all nodes and compute phi for all degrees of freedom on the boundary. Save phi in a list for later use.
initializeSurfaceData(mode);
// Update with factor
double am = 1.0, ap = 1.0;
computeCorrectionFactors(* mode, & dofs, & am, & ap);
OOFEM_LOG_INFO("Correction factors: am=%f, ap=%f\n", am, ap);
mode->ap = ap;
mode->am = am;
updateModelWithFactors(mode);
// myEngngModel->letOutputBaseFileNameBe(originalFilename + "_2_Updated");
modes.push_back(mode);
OOFEM_LOG_INFO("************************** Microproblem at %p instanciated \n", myEngngModel);
}
}