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();
    }
Exemplo n.º 2
0
    void ScalarDamageInterface2DLaw::FinalizeSolutionStep(const Properties& rMaterialProperties,
                                                          const GeometryType& rElementGeometry,
                                                          const Vector& rShapeFunctionsValues,
                                                          const ProcessInfo& rCurrentProcessInfo)
    {
#ifdef INTERF_DAM_2D_IMPLEX

		// implicit step
		// create dummy material parameters
		Vector dummy_stress(this->GetStrainSize());
		Matrix dummy_tangent(this->GetStrainSize(), this->GetStrainSize());
		ConstitutiveLaw::Parameters parameters(rElementGeometry, rMaterialProperties, rCurrentProcessInfo);
		parameters.SetStrainVector( m_strain );
		parameters.SetStressVector( dummy_stress );
		parameters.SetConstitutiveMatrix( dummy_tangent );
		Flags& options = parameters.GetOptions();
		options.Set(ConstitutiveLaw::COMPUTE_STRESS, true);
		options.Set(ConstitutiveLaw::COMPUTE_CONSTITUTIVE_TENSOR, false);
		options.Set(ConstitutiveLaw::INITIAL_CONFIGURATION);
		double detF = 1.0;
		double detF0 = 1.0;
		Matrix F(IdentityMatrix(2,2));
		Matrix F0(IdentityMatrix(2,2));
		parameters.SetDeterminantF(detF);
		parameters.SetDeterminantF0(detF0);
		parameters.SetDeformationGradientF(F);
		parameters.SetDeformationGradientF0(F0);
		// initialize calculation data
		CalculationData data;
		InitializeCalculationData(rMaterialProperties, rElementGeometry, m_strain, rCurrentProcessInfo, data);
		CalculateElasticStressVector( data, m_strain );
		// calculate internal variables implicitly
		CalculateEquivalentMeasure( data );
		UpdateDamage( data );
		mD1 = data.D1;
		mD2 = data.D2;

		// move from n to n-1
		mK1_converged_old  = mK1_converged;
		mK2_converged_old  = mK2_converged;
		m_dTime_n_converged = m_dTime_n;

#endif // INTERF_DAM_2D_IMPLEX

		// save converged values
		mK1_converged = mK1;
		mK2_converged = mK2;
		mD2_bar_converged = mD2_bar;
    }
Exemplo n.º 3
0
    void ScalarDamageInterface2DLaw::CalculateMaterialResponseCauchy (Parameters& rValues)
    {
        const Properties& props = rValues.GetMaterialProperties();
		const 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;

#ifdef INTERF_DAM_2D_IMPLEX
		this->m_strain = rValues.GetStrainVector();
#endif // INTERF_DAM_2D_IMPLEX

		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, rValues.GetProcessInfo(), data );
		CalculateElasticStressVector( data, strainVector );

#ifdef INTERF_DAM_2D_IMPLEX

		double time_factor = 0.0;
		if(m_dTime_n_converged>0.0) time_factor = data.dTime/m_dTime_n_converged;
		m_dTime_n = data.dTime;
		mK1 = mK1_converged + time_factor * (mK1_converged-mK1_converged_old);
		mK2 = mK2_converged + time_factor * (mK2_converged-mK2_converged_old);
		if(mK1 > 0.0)
		{
			data.D1 = 1.0 - data.Ft/(mK1+data.Ft) * std::exp( -data.Ft/(data.GI*data.Kn) * mK1 );
			data.D1 = std::max( std::min( data.D1, 1.0 ), 0.0 );
		}
		if(mK2 > 0.0)
		{
			data.D2 = 1.0 - data.C0/(mK2+data.C0) * std::exp( -data.C0/data.GII/data.Kt * mK2 );
			data.D2 = std::max( std::min( data.D2, 1.0 ), 0.0 );
		}
#ifdef USE_AS_BRICK_INTERFACE
		data.D2 = 0.0;
		if(data.D1 > 0.99)
			data.D2 = 1.0;
#endif // USE_AS_BRICK_INTERFACE
#else

		CalculateEquivalentMeasure( data );
		UpdateDamage( data );

#endif // INTERF_DAM_2D_IMPLEX

		mD1 = data.D1;
		mD2 = data.D2;
		
		if( compute_stress )
			CalculateStress( data, stressVector );

		//**********************************************
		double sig_n = stressVector(1);
		double sig_t = std::abs(stressVector(0));
		double C0_d = (1.0 - mD2)*data.C0;
		mYieldValue = sig_n*data.Fs + sig_t - C0_d;
		//**********************************************
		
		if( compute_constitutive_tensor )
		{
			if(data.ForceSecant) {
				constitutiveMatrix.clear();
				constitutiveMatrix(0,0) = data.Kt*(1.0-mD2);
				constitutiveMatrix(1,1) = data.Kn;
				if(stressVector(1) > 0.0) {
					constitutiveMatrix(1,1) *= (1.0-mD1);
				}
			}
			else {
				CalculateConstitutiveMatrix( data, strainVector, stressVector, constitutiveMatrix );
			}
		}
    }