本文整理汇总了C++中IR_GIVE_FIELD函数的典型用法代码示例。如果您正苦于以下问题:C++ IR_GIVE_FIELD函数的具体用法?C++ IR_GIVE_FIELD怎么用?C++ IR_GIVE_FIELD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了IR_GIVE_FIELD函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initializeFrom
IRResultType
NonlinearMassTransferMaterial :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
this->Material :: initializeFrom(ir);
IR_GIVE_FIELD(ir, C, IFT_NonlinearMassTransferMaterial_c, "c"); // Constant C
IR_GIVE_FIELD(ir, alpha, IFT_NonlinearMassTransferMaterial_alpha, "alpha"); // Constant alpha
return IRRT_OK;
}
示例2: initializeFrom
IRResultType
NonlinearFluidMaterial :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
this->FluidDynamicMaterial :: initializeFrom(ir);
IR_GIVE_FIELD(ir, viscosity, _IFT_NonlinearFluidMaterial_mu);
IR_GIVE_FIELD(ir, alpha, _IFT_NonlinearFluidMaterial_alpha);
IR_GIVE_FIELD(ir, c, _IFT_NonlinearFluidMaterial_C);
return IRRT_OK;
}
示例3: initializeFrom
IRResultType
TrabBoneEmbed :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
// Read material properties here
IR_GIVE_FIELD(ir, eps0, IFT_TrabBoneEmbed_eps0, "eps0"); // Macro
IR_GIVE_FIELD(ir, nu0, IFT_TrabBoneEmbed_nu0, "nu0"); // Macro
return StructuralMaterial :: initializeFrom(ir);
}
示例4: initializeFrom
IRResultType
DEIDynamic :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
StructuralEngngModel :: initializeFrom(ir);
IR_GIVE_FIELD(ir, dumpingCoef, IFT_DEIDynamic_dumpcoef, "dumpcoef"); // C = dumpingCoef * M
IR_GIVE_FIELD(ir, deltaT, IFT_DEIDynamic_deltat, "deltat"); // Macro
return IRRT_OK;
}
示例5: initializeFrom
IRResultType
WinklerPasternakMaterial :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
StructuralMaterial :: initializeFrom(ir);
// we use rather object's member data than to store data into slow
// key-val dictionary with lot of memory allocations
IR_GIVE_FIELD(ir, c1, _IFT_WinklerPasternakMaterial_C1);
IR_GIVE_FIELD(ir, c2, _IFT_WinklerPasternakMaterial_C2);
return IRRT_OK;
}
示例6: initializeFrom
IRResultType
RCM2Material :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
IR_GIVE_FIELD(ir, Gf, IFT_RCM2Material_gf, "gf"); // Macro
IR_GIVE_FIELD(ir, Ft, IFT_RCM2Material_ft, "ft"); // Macro
this->giveLinearElasticMaterial()->initializeFrom(ir);
return IRRT_OK;
}
示例7: initializeFrom
IRResultType Delamination :: initializeFrom(InputRecord *ir)
{
EnrichmentItem :: initializeFrom(ir);
IRResultType result; // Required by IR_GIVE_FIELD macro
// Compute the delamination xi-coord
IR_GIVE_FIELD(ir, this->interfaceNum, _IFT_Delamination_interfacenum); // interface number from the bottom
IR_GIVE_FIELD(ir, this->crossSectionNum, _IFT_Delamination_csnum);
LayeredCrossSection *layeredCS = dynamic_cast< LayeredCrossSection * >( this->giveDomain()->giveCrossSection(this->crossSectionNum) );
if ( layeredCS == NULL ) {
OOFEM_ERROR("Delamination EI requires a valid layered cross section number input: see record '%s'.", _IFT_Delamination_csnum);
} else if ( this->interfaceNum.giveSize() < 1 || this->interfaceNum.giveSize() > 2 ) {
OOFEM_ERROR("Size of record 'interfacenum' must be 1 or 2");
}
// check that interface numbers are valid
interfaceNum.printYourself("interface num");
for ( int i = 1; i <= this->interfaceNum.giveSize(); i++ ) {
if ( this->interfaceNum.at(i) < 1 || this->interfaceNum.at(i) >= layeredCS->giveNumberOfLayers() ) {
OOFEM_ERROR( "Cross section does not contain the interface number (%d) specified in the record '%s' since number of layers is %d.", this->interfaceNum.at(i), _IFT_Delamination_interfacenum, layeredCS->giveNumberOfLayers() );
}
}
// compute xi-coord of the delamination
this->delamXiCoord = -1.0;
double totalThickness = layeredCS->give(CS_Thickness, FloatArray(), NULL, false); // no position available
for ( int i = 1; i <= this->interfaceNum.at(1); i++ ) {
this->delamXiCoord += layeredCS->giveLayerThickness(i) / totalThickness * 2.0;
this->xiBottom += layeredCS->giveLayerThickness(i) / totalThickness * 2.0;
}
if ( this->interfaceNum.giveSize() == 2 ) {
if ( this->interfaceNum.at(1) >= this->interfaceNum.at(2) ) {
OOFEM_ERROR("second intercfacenum must be greater than the first one");
}
for ( int i = 1; i <= this->interfaceNum.at(2); i++ ) {
this->xiTop += layeredCS->giveLayerThickness(i) / totalThickness * 2.0;
}
} else {
this->xiTop = 1.0; // default is the top surface
}
IR_GIVE_OPTIONAL_FIELD(ir, this->matNum, _IFT_Delamination_CohesiveZoneMaterial);
if ( this->matNum > 0 ) {
this->mat = this->giveDomain()->giveMaterial(this->matNum);
}
return IRRT_OK;
}
示例8: initializeFrom
IRResultType
IsotropicHeatTransferMaterial :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
// double value ;
this->Material :: initializeFrom(ir);
IR_GIVE_FIELD(ir, conductivity, IFT_IsotropicHeatTransferMaterial_k, "k"); // Macro// conductivity
IR_GIVE_FIELD(ir, capacity, IFT_IsotropicHeatTransferMaterial_c, "c"); // Macro// specific heat capacity
return IRRT_OK;
}
示例9: initializeFrom
IRResultType
CohesiveInterfaceMaterial :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
// elastic parameters
IR_GIVE_FIELD(ir, kn, _IFT_IsoInterfaceDamageMaterial_kn);
IR_GIVE_FIELD(ir, ks, _IFT_IsoInterfaceDamageMaterial_ks);
// thermal coefficient
tempDillatCoeff = 0.0;
return StructuralMaterial :: initializeFrom(ir);
}
示例10: initializeFrom
IRResultType
StaticFracture :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
IR_GIVE_FIELD(ir, this->numberOfSteps, _IFT_OptimizationProblem_nsteps);
if ( this->numberOfSteps <= 0 ) {
_error("instanciateFrom: nsteps not specified, bad format");
}
//if ( ir->hasField(_IFT_StaggeredProblem_deltat) ) {
// EngngModel :: initializeFrom(ir);
// IR_GIVE_FIELD(ir, deltaT, _IFT_StaggeredProblem_deltat);
// dtTimeFunction = 0;
//} else if ( ir->hasField(_IFT_StaggeredProblem_prescribedtimes) ) {
// EngngModel :: initializeFrom(ir);
// IR_GIVE_FIELD(ir, discreteTimes, _IFT_StaggeredProblem_prescribedtimes);
// dtTimeFunction = 0;
//} else {
// IR_GIVE_FIELD(ir, timeDefinedByProb, _IFT_StaggeredProblem_timeDefinedByProb);
//}
//if ( dtTimeFunction < 1 ) {
// ndomains = 0;
//}
//IR_GIVE_OPTIONAL_FIELD(ir, dtTimeFunction, _IFT_StaggeredProblem_dtf);
//IR_GIVE_OPTIONAL_FIELD(ir, stepMultiplier, _IFT_StaggeredProblem_stepmultiplier);
//if ( stepMultiplier < 0 ) {
// _error("stepMultiplier must be > 0")
//}
IR_GIVE_FIELD(ir, this->numObjFunc, _IFT__IFT_OptimizationProblem_NumObjFunc);
emodelList = new AList< EngngModel >(1);
inputStreamNames = new std :: string [ 1 ];
//for (int i = 1; i <= this->numObjFunc; i++) {
//IR_GIVE_FIELD(ir, inputStreamNames [ i-1 ], _IFT__IFT_OptimizationProblem_Name_prob1);
//}
IR_GIVE_FIELD(ir, inputStreamNames [ 0 ], _IFT__IFT_OptimizationProblem_Name_prob1);
// IR_GIVE_FIELD(ir, inputStreamNames [ 1 ], "top.in");
this->objFuncList.resize(1);
this->objFuncList[0] = new MinCompliance();
return IRRT_OK;
}
示例11: initializeFrom
IRResultType
LineDistributedSpring :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
IR_GIVE_FIELD (ir, dofs, _IFT_LineDistributedSpring_Dofs);
IR_GIVE_FIELD (ir, springStiffnesses, _IFT_LineDistributedSpring_Stifnesses);
if (dofs.giveSize() != springStiffnesses.giveSize()) {
OOFEM_ERROR ("dofs and k params size mismatch");
}
// from element
return StructuralElement::initializeFrom(ir);
}
示例12: initializeFrom
IRResultType
NonStationaryTransportProblem :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
result = EngngModel :: initializeFrom(ir);
if ( result != IRRT_OK ) return result;
if ( ir->hasField(_IFT_NonStationaryTransportProblem_initt) ) {
IR_GIVE_FIELD(ir, initT, _IFT_NonStationaryTransportProblem_initt);
}
if ( ir->hasField(_IFT_NonStationaryTransportProblem_deltat) ) {
IR_GIVE_FIELD(ir, deltaT, _IFT_NonStationaryTransportProblem_deltat);
} else if ( ir->hasField(_IFT_NonStationaryTransportProblem_deltatfunction) ) {
IR_GIVE_FIELD(ir, dtFunction, _IFT_NonStationaryTransportProblem_deltatfunction);
} else if ( ir->hasField(_IFT_NonStationaryTransportProblem_prescribedtimes) ) {
IR_GIVE_FIELD(ir, discreteTimes, _IFT_NonStationaryTransportProblem_prescribedtimes);
} else {
OOFEM_WARNING("Time step not defined");
return IRRT_BAD_FORMAT;
}
IR_GIVE_FIELD(ir, alpha, _IFT_NonStationaryTransportProblem_alpha);
/* The following done in updateAttributes
* if (this->giveNumericalMethod (giveCurrentStep())) nMethod -> instanciateFrom (ir);
*/
// read lumped capacity stabilization flag
if ( ir->hasField(_IFT_NonStationaryTransportProblem_lumpedcapa) ) {
lumpedCapacityStab = 1;
}
//secure equation renumbering, otherwise keep efficient algorithms
if ( ir->hasField(_IFT_NonStationaryTransportProblem_changingproblemsize) ) {
changingProblemSize = true;
UnknownsField.reset( new DofDistributedPrimaryField(this, 1, FT_TransportProblemUnknowns, 1) );
} else {
UnknownsField.reset( new PrimaryField(this, 1, FT_TransportProblemUnknowns, 1) );
}
//read other input data from StationaryTransportProblem
StationaryTransportProblem :: initializeFrom(ir);
int val = 0;
IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
solverType = ( LinSystSolverType ) val;
return IRRT_OK;
}
示例13: initializeFrom
IRResultType
TutorialMaterial :: initializeFrom(InputRecord *ir)
{
IRResultType result; // Required by IR_GIVE_FIELD macro
result = D.initializeFrom(ir);
if ( result != IRRT_OK ) return result;
IR_GIVE_FIELD(ir, this->sig0, _IFT_TutorialMaterial_yieldstress);
IR_GIVE_FIELD(ir, this->H, _IFT_TutorialMaterial_hardeningmoduli);
return StructuralMaterial :: initializeFrom(ir);
}
示例14: initializeFrom
IRResultType
NonlinearFluidMaterial :: initializeFrom(InputRecord *ir)
{
const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
IRResultType result; // Required by IR_GIVE_FIELD macro
this->FluidDynamicMaterial :: initializeFrom(ir);
IR_GIVE_FIELD(ir, viscosity, IFT_NewtonianFluidMaterial_mu, "mu"); // Macro
IR_GIVE_FIELD(ir, alpha, IFT_NonlinearFluidMaterial_alpha, "alpha"); // Macro
IR_GIVE_FIELD(ir, c, IFT_NonlinearFluidMaterial_C, "c"); // Macro
return IRRT_OK;
}
示例15: initializeFrom
IRResultType TransportGradientPeriodic :: initializeFrom(InputRecord *ir)
{
IRResultType result;
IR_GIVE_FIELD(ir, this->mGradient, _IFT_TransportGradientPeriodic_gradient)
this->mCenterCoord = {0., 0., 0.};
IR_GIVE_OPTIONAL_FIELD(ir, this->mCenterCoord, _IFT_TransportGradientPeriodic_centerCoords)
IR_GIVE_FIELD(ir, this->masterSet, _IFT_TransportGradientPeriodic_masterSet)
IR_GIVE_FIELD(ir, this->jump, _IFT_TransportGradientPeriodic_jump)
return ActiveBoundaryCondition :: initializeFrom(ir);
//return PrescribedGradientHomogenization::initializeFrom(ir);
}