Example #1
0
// calculate properties used in analyses
const char *Orthotropic::VerifyAndLoadProperties(int np)
{
    // finish input
    if(!read[NUXY_PROP])
    {	nuxy=nuyx*Ex/Ey;
        read[NUXY_PROP]=1;
    }
    else if(!read[NUYX_PROP])
    {	nuyx=nuxy*Ey/Ex;
        read[NUYX_PROP]=1;
    }
    else
		return "nuxy and nuyx both given. Only one is allowed";
    
    if(!read[NUXZ_PROP])
    {	nuxz=nuzx*Ex/Ez;
        read[NUXZ_PROP]=1;
    }
    else if(!read[NUZX_PROP])
    {	nuzx=nuxz*Ez/Ex;
        read[NUZX_PROP]=1;
    }
    else
		return "nuxz and nuzx both given. Only one is allowed";
    
    if(!read[NUYZ_PROP])
    {	nuyz=nuzy*Ey/Ez;
        read[NUYZ_PROP]=1;
    }
    else if(!read[NUZY_PROP])
    {	nuzy=nuyz*Ez/Ey;
        read[NUZY_PROP]=1;
    }
    else
		return "nuyz and nuzy both given. Only one is allowed";
    
    int i;
    for(i=0;i<ORTHO_PROPS;i++)
    {	if(!read[i])
			return "A required material property is missing";
    }

#ifdef MPM_CODE
    // make conductivty specific (N mm^3/(sec-K-g))
    kCondz /= rho;
#endif
	
    // set properties
    const char *err=SetAnalysisProps(np,Ex,Ey,Ez,nuxy,nuxz,nuyz,
							Gxy,Gxz,Gyz,1.e-6*ax,1.e-6*ay,1.e-6*az,
							betax*concSaturation,betay*concSaturation,betaz*concSaturation);
	if(err!=NULL) return err;
	
	// load elastic properties with constant values
	FillUnrotatedElasticProperties(&pr,np);
	
	// superclass call (but skip over TransIsotropic)
	return MaterialBase::VerifyAndLoadProperties(np);
}
// Verify properties and initial calculations
const char *BistableIsotropic::VerifyAndLoadProperties(int np)
{
    // Require initial properties, but second are optional
    //	They equal first if not provide
    if(!readbs[K0_PROP] || !readbs[G0_PROP] || !readbs[A0_PROP])
		return "Initial K0, G0, or alpha0 is missing.";
	if(!readbs[B0_PROP])
		beta0=0.;
    if(!readbs[TRANSITION_PROP] || rule<DILATION_RULE || rule>VONMISES_RULE)
		return "Phase transition rule is missing or invalid.";
    
    // if not provided, no change in property at transition
    if(!readbs[KD_PROP]) Kd=K0;
    if(!readbs[GD_PROP]) Gd=G0;
    if(!readbs[AD_PROP]) ad=a0;
    if(!readbs[BD_PROP]) betad=beta0;
    if(!readbs[DIFFD_PROP]) diffd=diff0;
    if(!readbs[KCONDD_PROP]) kCondd=kCond0;
    
    // no change in heat capacity
    
    // make conductivty specific (nJ mm^2/(sec-K-g))
    kCond0 /= rho;
    kCondd /= rho;
    
    // test validity of each state
    const char *err=CurrentProperties(DEFORMED_STATE,np);
    if(err!=NULL) return err;
	FillUnrotatedElasticProperties(&pr2,np);
	FillTransportProperties(&tr2);
	
    err=CurrentProperties(INITIAL_STATE,np);
    if(err!=NULL) return err;
	FillUnrotatedElasticProperties(&pr,np);
	// transport gets done in material base
	
    // convert strain rules in percent to absolute strains
    if(rule==VONMISES_RULE)
		dVcrit *= UnitsController::Scaling(1.e6)/rho;			// convert to specific stress
	else
		dVcrit /= 100.;											// % to absolute strain
    dVii/=100.;
	
	// call super-super class (skip IsotropicMat due to conflicts and Elastic because has none)
	return MaterialBase::VerifyAndLoadProperties(np);
}