void ConvDiffAnisotropic2DLaw::CalculateStress(const Properties& props,
												   const Vector& strainVector,
												   Vector& stressVector)
	{
		double CONDUCTIVITY_11_11 = props[CONDUCTIVITY_1111];
		double CONDUCTIVITY_11_22 = props[CONDUCTIVITY_1122];
		double CONDUCTIVITY_22_11 = props[CONDUCTIVITY_2211];
		double CONDUCTIVITY_22_22 = props[CONDUCTIVITY_2222];
		
		SizeType strain_size = strainVector.size();

		Matrix constitutiveMatrix(strain_size, strain_size, false);
		constitutiveMatrix(0, 0) = CONDUCTIVITY_11_11;
		constitutiveMatrix(0, 1) = CONDUCTIVITY_11_22;
		constitutiveMatrix(1, 0) = CONDUCTIVITY_22_11;
		constitutiveMatrix(1, 1) = CONDUCTIVITY_22_22;
		
		mStressVector.clear();
		mStressVector = prod(constitutiveMatrix, strainVector - m_init_gradT);
		
		// mStressVector(0) = conductivity*(strainVector(0) - m_init_gradT(0));
		// mStressVector(1) = conductivity*(strainVector(1) - m_init_gradT(1));
		
		noalias(stressVector) = mStressVector;
	}
Example #2
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 );
			}
		}
    }