当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessInfo::GetValue方法代码示例

本文整理汇总了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("")
}
开发者ID:KratosCSIC,项目名称:trunk,代码行数:62,代码来源:thermal_face2D.cpp

示例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));
    }
}
开发者ID:KratosCSIC,项目名称:trunk,代码行数:13,代码来源:thermal_face2d.cpp

示例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();
    }
}
开发者ID:KratosCSIC,项目名称:trunk,代码行数:15,代码来源:thermal_face2d.cpp


注:本文中的ProcessInfo::GetValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。