本文整理汇总了C++中EngngModel::instanciateYourself方法的典型用法代码示例。如果您正苦于以下问题:C++ EngngModel::instanciateYourself方法的具体用法?C++ EngngModel::instanciateYourself怎么用?C++ EngngModel::instanciateYourself使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EngngModel
的用法示例。
在下文中一共展示了EngngModel::instanciateYourself方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fail
EngngModel *InstanciateProblem(DataReader *dr, problemMode mode, int contextFlag, EngngModel *_master, bool parallelFlag)
{
const char *__proc = "InstanciateProblem"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
EngngModel *problem;
std::string problemName, dataOutputFileName, desc;
dataOutputFileName = dr->giveOutputFileName();
desc = dr->giveDescription();
/* here we need copy of input record. The pointer returned by dr->giveInputRecord can (and will)
* be updated as reading e-model components (nodes, etc). But we need this record being available
* through the whole e-model instanciation
*/
InputRecord *emodelir = dr->giveInputRecord(DataReader :: IR_emodelRec, 1)->GiveCopy();
result = emodelir->giveRecordKeywordField(problemName); ///@todo Make this function robust, it can't be allowed to fail (the record keyword is not a normal field-id)
if ( result != IRRT_OK ) {
IR_IOERR("", __proc, "", emodelir, result);
}
problem = classFactory.createEngngModel(problemName.c_str(), 1, _master);
if (!problem) {
OOFEM_ERROR2("EngngModel::InstanciateProblem - Failed to construct engineering model if type \"%s\".\n", problemName.c_str());
}
problem->setProblemMode(mode);
problem->setParallelMode(parallelFlag);
if ( contextFlag ) {
problem->setContextOutputMode(COM_Always);
}
problem->instanciateYourself(dr, emodelir, dataOutputFileName.c_str(), desc.c_str());
delete emodelir;
return problem;
}