本文整理汇总了C++中DataReader::giveInputRecord方法的典型用法代码示例。如果您正苦于以下问题:C++ DataReader::giveInputRecord方法的具体用法?C++ DataReader::giveInputRecord怎么用?C++ DataReader::giveInputRecord使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DataReader
的用法示例。
在下文中一共展示了DataReader::giveInputRecord方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: instanciateYourself
int XfemManager :: instanciateYourself(DataReader &dr)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
std :: string name;
enrichmentItemList.resize(numberOfEnrichmentItems);
for ( int i = 1; i <= numberOfEnrichmentItems; i++ ) {
InputRecord *mir = dr.giveInputRecord(DataReader :: IR_enrichItemRec, i);
result = mir->giveRecordKeywordField(name);
if ( result != IRRT_OK ) {
mir->report_error(this->giveClassName(), __func__, "", result, __FILE__, __LINE__);
}
std :: unique_ptr< EnrichmentItem >ei( classFactory.createEnrichmentItem( name.c_str(), i, this, this->giveDomain() ) );
if ( ei.get() == NULL ) {
OOFEM_ERROR( "unknown enrichment item (%s)", name.c_str() );
}
ei->initializeFrom(mir);
ei->instanciateYourself(dr);
this->enrichmentItemList [ i - 1 ] = std :: move(ei);
}
mNucleationCriteria.resize(numberOfNucleationCriteria);
for ( int i = 1; i <= numberOfNucleationCriteria; i++ ) {
InputRecord *mir = dr.giveInputRecord(DataReader :: IR_crackNucleationRec, i);
result = mir->giveRecordKeywordField(name);
if ( result != IRRT_OK ) {
mir->report_error(this->giveClassName(), __func__, "", result, __FILE__, __LINE__);
}
std :: unique_ptr< NucleationCriterion >nc( classFactory.createNucleationCriterion( name.c_str(), this->giveDomain() ) );
if ( nc.get() == NULL ) {
OOFEM_ERROR( "Unknown nucleation criterion: (%s)", name.c_str() );
}
nc->initializeFrom(mir);
nc->instanciateYourself(dr);
this->mNucleationCriteria [ i - 1 ] = std :: move(nc);
}
updateNodeEnrichmentItemMap();
return 1;
}
示例2: instanciateYourself
int Delamination :: instanciateYourself(DataReader &dr)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
std :: string name;
// Instantiate enrichment function
InputRecord *mir = dr.giveInputRecord(DataReader :: IR_enrichFuncRec, 1);
result = mir->giveRecordKeywordField(name);
if ( result != IRRT_OK ) {
mir->report_error(this->giveClassName(), __func__, "", result, __FILE__, __LINE__);
}
mpEnrichmentFunc = classFactory.createEnrichmentFunction( name.c_str(), 1, this->giveDomain() );
if ( mpEnrichmentFunc != NULL ) {
mpEnrichmentFunc->initializeFrom(mir);
} else {
OOFEM_ERROR( "failed to create enrichment function (%s)", name.c_str() );
}
// Instantiate enrichment domain
mir = dr.giveInputRecord(DataReader :: IR_geoRec, 1);
result = mir->giveRecordKeywordField(name);
if ( result != IRRT_OK ) {
mir->report_error(this->giveClassName(), __func__, "", result, __FILE__, __LINE__);
}
IntArray idList;
IR_GIVE_FIELD(mir, idList, _IFT_ListBasedEI_list);
for ( int i = 1; i <= idList.giveSize(); i++ ) {
this->dofManList.push_back( idList.at(i) );
}
std :: sort( dofManList.begin(), this->dofManList.end() );
//IR_GIVE_FIELD(ir, this->xi, _IFT_DofManList_DelaminationLevel);
// Instantiate EnrichmentFront
if ( mEnrFrontIndex == 0 ) {
mpEnrichmentFrontStart = new EnrFrontDoNothing(this->giveNumber());
mpEnrichmentFrontEnd = new EnrFrontDoNothing(this->giveNumber());
} else {
std :: string enrFrontNameStart, enrFrontNameEnd;
InputRecord *enrFrontStartIr = dr.giveInputRecord(DataReader :: IR_enrichFrontRec, mEnrFrontIndex);
result = enrFrontStartIr->giveRecordKeywordField(enrFrontNameStart);
mpEnrichmentFrontStart = classFactory.createEnrichmentFront( enrFrontNameStart.c_str() );
if ( mpEnrichmentFrontStart != NULL ) {
mpEnrichmentFrontStart->initializeFrom(enrFrontStartIr);
//printf("EnrichmentFrontStart : %s \n", mpEnrichmentFrontStart->giveClassName());
} else {
OOFEM_ERROR( "Failed to create enrichment front (%s)", enrFrontNameStart.c_str() );
}
InputRecord *enrFrontEndIr = dr.giveInputRecord(DataReader :: IR_enrichFrontRec, mEnrFrontIndex);
result = enrFrontEndIr->giveRecordKeywordField(enrFrontNameEnd);
mpEnrichmentFrontEnd = classFactory.createEnrichmentFront( enrFrontNameEnd.c_str() );
if ( mpEnrichmentFrontEnd != NULL ) {
mpEnrichmentFrontEnd->initializeFrom(enrFrontEndIr);
//printf("EnrichmentFrontEnd : %s \n", mpEnrichmentFrontEnd->giveClassName());
} else {
OOFEM_ERROR( "Failed to create enrichment front (%s)", enrFrontNameEnd.c_str() );
}
}
// Instantiate PropagationLaw
if ( mPropLawIndex == 0 ) {
mpPropagationLaw = new PLDoNothing();
} else {
std :: string propLawName;
InputRecord *propLawir = dr.giveInputRecord(DataReader :: IR_propagationLawRec, mPropLawIndex);
result = propLawir->giveRecordKeywordField(propLawName);
mpPropagationLaw = classFactory.createPropagationLaw( propLawName.c_str() );
if ( mpPropagationLaw != NULL ) {
mpPropagationLaw->initializeFrom(propLawir);
} else {
OOFEM_ERROR( "Failed to create propagation law (%s)", propLawName.c_str() );
}
}
// Set start of the enrichment dof pool for the given EI
int xDofPoolAllocSize = this->giveDofPoolSize();
this->startOfDofIdPool = this->giveDomain()->giveNextFreeDofID(xDofPoolAllocSize);
this->endOfDofIdPool = this->startOfDofIdPool + xDofPoolAllocSize - 1;
XfemManager *xMan = this->giveDomain()->giveXfemManager();
// mpEnrichmentDomain->CallNodeEnrMarkerUpdate(* this, * xMan);
this->updateNodeEnrMarker(* xMan);
//writeVtkDebug();
return 1;
}