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


C++ Parameters::GetElementGeometry方法代码示例

本文整理汇总了C++中Parameters::GetElementGeometry方法的典型用法代码示例。如果您正苦于以下问题:C++ Parameters::GetElementGeometry方法的具体用法?C++ Parameters::GetElementGeometry怎么用?C++ Parameters::GetElementGeometry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Parameters的用法示例。


在下文中一共展示了Parameters::GetElementGeometry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetStrainSize

    void ConvDiffInterface2DLaw::CalculateMaterialResponseCauchy (Parameters& rValues)
    {
        const Properties& props = rValues.GetMaterialProperties();
		Vector& strainVector = rValues.GetStrainVector();
		Vector& stressVector = rValues.GetStressVector();
		Matrix& constitutiveMatrix = rValues.GetConstitutiveMatrix();
		Flags& Options = rValues.GetOptions();
		bool compute_constitutive_tensor = Options.Is(COMPUTE_CONSTITUTIVE_TENSOR);
		bool compute_stress = Options.Is(COMPUTE_STRESS) || compute_constitutive_tensor;

		SizeType size = GetStrainSize();

		if(compute_stress) 
			if(stressVector.size() != size)
				stressVector.resize(size, false);
		if(compute_constitutive_tensor)
			if(constitutiveMatrix.size1() != size || constitutiveMatrix.size2() != size)
				constitutiveMatrix.resize(size, size, false);

		CalculationData data;
				
		InitializeCalculationData( props, rValues.GetElementGeometry(), strainVector, data );

		std::stringstream ss;
		//std::cout << "CalculateMaterialResponseCauchy -  strainVector = " << strainVector << std::endl;
		//std::cout << "CalculateMaterialResponseCauchy -  constitutiveMatrix = " << constitutiveMatrix << std::endl;
		
		if (data.ExpCurveTypeFlag)
		{
			CalculateElasticStressVector(data, strainVector);
			//std::cout << "CalculateMaterialResponseCauchy -  ElasticStressVector = " << data.ElasticStressVector << std::endl;
			CalculateEquivalentMeasure(data);
			UpdateDamage(data);
			CalculateContactConductivity(data);
		}
		else
		{
			CalculateEffectiveOpening(data);
			UpdateDamage(data);
			CalculateContactConductivity(data);
		}

		mD1 = data.D1; // Update the mK1 to the current value
		
		if( compute_stress )
		{
			CalculateStress(data, strainVector, stressVector);
		}
		//std::cout << "CalculateMaterialResponseCauchy -  CalculateStress = " << stressVector << std::endl;

		if( compute_constitutive_tensor )
		{
			CalculateConstitutiveMatrix( data, strainVector, stressVector, constitutiveMatrix );
		}

		std::cout << ss.str();
    }
开发者ID:KratosCSIC,项目名称:trunk,代码行数:57,代码来源:conv_diff_interface_2d_law.cpp

示例2: if

void  HyperElasticUP3DLaw::CalculateMaterialResponsePK2 (Parameters& rValues)
{

    //-----------------------------//

    //a.-Check if the constitutive parameters are passed correctly to the law calculation
    CheckParameters(rValues);

    //b.- Get Values to compute the constitutive law:
    Flags &Options=rValues.GetOptions();

    const Properties& MaterialProperties  = rValues.GetMaterialProperties();
    const Matrix&   DeformationGradientF  = rValues.GetDeformationGradientF();
    const double&   DeterminantF          = rValues.GetDeterminantF();

    const GeometryType&  DomainGeometry   = rValues.GetElementGeometry ();
    const Vector&        ShapeFunctions   = rValues.GetShapeFunctionsValues ();

    Vector& StrainVector                  = rValues.GetStrainVector();
    Vector& StressVector                  = rValues.GetStressVector();
    Matrix& ConstitutiveMatrix            = rValues.GetConstitutiveMatrix();

    //-----------------------------//

    //0.- Initialize parameters
    MaterialResponseVariables ElasticVariables;
    ElasticVariables.Identity = identity_matrix<double> ( 3 );

    ElasticVariables.SetElementGeometry(DomainGeometry);
    ElasticVariables.SetShapeFunctionsValues(ShapeFunctions);

    // Initialize Splited Parts: Isochoric and Volumetric stresses and constitutive tensors
    double voigtsize = StressVector.size();
    VectorSplit SplitStressVector;
    MatrixSplit SplitConstitutiveMatrix;

    //1.- Lame constants
    const double& YoungModulus          = MaterialProperties[YOUNG_MODULUS];
    const double& PoissonCoefficient    = MaterialProperties[POISSON_RATIO];

    ElasticVariables.LameLambda      = (YoungModulus*PoissonCoefficient)/((1+PoissonCoefficient)*(1-2*PoissonCoefficient));
    ElasticVariables.LameMu          =  YoungModulus/(2*(1+PoissonCoefficient));

    //2.- Thermal constants
    if( MaterialProperties.Has(THERMAL_EXPANSION_COEFFICIENT) )
      ElasticVariables.ThermalExpansionCoefficient = MaterialProperties[THERMAL_EXPANSION_COEFFICIENT];
    else
      ElasticVariables.ThermalExpansionCoefficient = 0;

    if( MaterialProperties.Has(REFERENCE_TEMPERATURE) )
      ElasticVariables.ReferenceTemperature = MaterialProperties[REFERENCE_TEMPERATURE];
    else
      ElasticVariables.ReferenceTemperature = 0;

    //3.-DeformationGradient Tensor 3D
    ElasticVariables.DeformationGradientF = DeformationGradientF;
    ElasticVariables.DeformationGradientF = Transform2DTo3D( ElasticVariables.DeformationGradientF );

    //4.-Determinant of the Total Deformation Gradient
    ElasticVariables.DeterminantF = DeterminantF;

    //5.-Right Cauchy Green tensor C
    Matrix RightCauchyGreen = prod(trans(ElasticVariables.DeformationGradientF),ElasticVariables.DeformationGradientF);

    //6.-Inverse of the Right Cauchy-Green tensor C: (stored in the CauchyGreenMatrix)
    ElasticVariables.traceCG = 0;
    ElasticVariables.CauchyGreenMatrix( 3, 3 );
    MathUtils<double>::InvertMatrix( RightCauchyGreen, ElasticVariables.CauchyGreenMatrix, ElasticVariables.traceCG);


    //8.-Green-Lagrange Strain:
    if(Options.Is( ConstitutiveLaw::COMPUTE_STRAIN ))
      {
	this->CalculateGreenLagrangeStrain(RightCauchyGreen, StrainVector);
      }
    
    //9.-Calculate Total PK2 stress
    SplitStressVector.Isochoric = ZeroVector(voigtsize);

    if( Options.Is(ConstitutiveLaw::COMPUTE_STRESS ) || Options.Is(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR ) )
      this->CalculateIsochoricStress( ElasticVariables, StressMeasure_PK2, SplitStressVector.Isochoric );

    Vector IsochoricStressVector = SplitStressVector.Isochoric;

    if( Options.Is( ConstitutiveLaw::COMPUTE_STRESS ) )
      {

	SplitStressVector.Volumetric = ZeroVector(voigtsize);

	this->CalculateVolumetricStress ( ElasticVariables, SplitStressVector.Volumetric );

	//PK2 Stress:
	StressVector = SplitStressVector.Isochoric + SplitStressVector.Volumetric;
	
	if( Options.Is(ConstitutiveLaw::ISOCHORIC_TENSOR_ONLY ) )
	  {
	    StressVector = SplitStressVector.Isochoric;
	  }
	else if( Options.Is(ConstitutiveLaw::VOLUMETRIC_TENSOR_ONLY ) )
	  {
//.........这里部分代码省略.........
开发者ID:KratosCSIC,项目名称:trunk,代码行数:101,代码来源:hyperelastic_U_P_3D_law.cpp


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