本文整理汇总了C++中ProcessInfo::GetValue方法的典型用法代码示例。如果您正苦于以下问题:C++ ProcessInfo::GetValue方法的具体用法?C++ ProcessInfo::GetValue怎么用?C++ ProcessInfo::GetValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ProcessInfo
的用法示例。
在下文中一共展示了ProcessInfo::GetValue方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetGeometry
//************************************************************************************
//************************************************************************************
void ThermalFace2D::CalculateAll(MatrixType& rLeftHandSideMatrix, VectorType& rRightHandSideVector, ProcessInfo& rCurrentProcessInfo, bool CalculateStiffnessMatrixFlag, bool CalculateResidualVectorFlag)
{
KRATOS_TRY
unsigned int number_of_nodes = GetGeometry().size();
//resizing as needed the LHS
unsigned int MatSize=number_of_nodes;
ConvectionDiffusionSettings::Pointer my_settings = rCurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
const Variable<double>& rUnknownVar = my_settings->GetUnknownVariable();
const Variable<double>& rSurfaceSourceVar = my_settings->GetSurfaceSourceVariable();
//calculate lenght
double x21 = GetGeometry()[1].X() - GetGeometry()[0].X();
double y21 = GetGeometry()[1].Y() - GetGeometry()[0].Y();
double lenght = x21*x21 + y21*y21;
lenght = sqrt(lenght);
const Properties& ConstProp = GetProperties();
const double& ambient_temperature = ConstProp[AMBIENT_TEMPERATURE];
double StefenBoltzmann = 5.67e-8;
double emissivity = ConstProp[EMISSIVITY];
double convection_coefficient = ConstProp[CONVECTION_COEFFICIENT];
const double& T0 = GetGeometry()[0].FastGetSolutionStepValue(rUnknownVar);
const double& T1 = GetGeometry()[1].FastGetSolutionStepValue(rUnknownVar);
const double& q0 =GetGeometry()[0].FastGetSolutionStepValue(rSurfaceSourceVar);
const double& q1 =GetGeometry()[1].FastGetSolutionStepValue(rSurfaceSourceVar);
if (CalculateStiffnessMatrixFlag == true) //calculation of the matrix is required
{
if(rLeftHandSideMatrix.size1() != MatSize )
rLeftHandSideMatrix.resize(MatSize,MatSize,false);
noalias(rLeftHandSideMatrix) = ZeroMatrix(MatSize,MatSize);
rLeftHandSideMatrix(0,0) = ( convection_coefficient + emissivity*StefenBoltzmann*4.0*pow(T0,3) )* 0.5 * lenght;
rLeftHandSideMatrix(1,1) = ( convection_coefficient + emissivity*StefenBoltzmann*4.0*pow(T1,3) )* 0.5 * lenght;
}
//resizing as needed the RHS
double aux = pow(ambient_temperature,4);
if (CalculateResidualVectorFlag == true) //calculation of the matrix is required
{
if(rRightHandSideVector.size() != MatSize )
rRightHandSideVector.resize(MatSize,false);
rRightHandSideVector[0] = q0 - emissivity*StefenBoltzmann*(pow(T0,4) - aux) - convection_coefficient * ( T0 - ambient_temperature);
rRightHandSideVector[1] = q1 - emissivity*StefenBoltzmann*(pow(T1,4) - aux) - convection_coefficient * ( T1 - ambient_temperature);
rRightHandSideVector *= 0.5*lenght;
}
KRATOS_CATCH("")
}
示例2:
//************************************************************************************
//************************************************************************************
void ThermalFace2D::GetDofList(DofsVectorType& ConditionalDofList,ProcessInfo& CurrentProcessInfo)
{
ConvectionDiffusionSettings::Pointer my_settings = CurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
const Variable<double>& rUnknownVar = my_settings->GetUnknownVariable();
ConditionalDofList.resize(GetGeometry().size());
for (unsigned int i=0; i<GetGeometry().size(); i++)
{
ConditionalDofList[i] = (GetGeometry()[i].pGetDof(rUnknownVar));
}
}
示例3: GetGeometry
//************************************************************************************
//************************************************************************************
void ThermalFace2D::EquationIdVector(EquationIdVectorType& rResult, ProcessInfo& CurrentProcessInfo)
{
ConvectionDiffusionSettings::Pointer my_settings = CurrentProcessInfo.GetValue(CONVECTION_DIFFUSION_SETTINGS);
const Variable<double>& rUnknownVar = my_settings->GetUnknownVariable();
unsigned int number_of_nodes = GetGeometry().PointsNumber();
if(rResult.size() != number_of_nodes)
rResult.resize(number_of_nodes,false);
for (unsigned int i=0; i<number_of_nodes; i++)
{
rResult[i] = (GetGeometry()[i].GetDof(rUnknownVar)).EquationId();
}
}