Exemplo n.º 1
0
IRResultType
ZZErrorEstimator :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    int n;

    ErrorEstimator :: initializeFrom(ir);
    n = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, n, _IFT_ZZErrorEstimator_normtype);
    if ( n == 1 ) {
        this->normType = EnergyNorm;
    } else {
        this->normType = L2Norm; // default
    }

    n = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, n, _IFT_ZZErrorEstimator_recoverytype);
    if ( n == 1 ) {
        this->nodalRecoveryType = SPRRecovery;
    } else {
        this->nodalRecoveryType = ZZRecovery; // default
    }

    return this->giveRemeshingCrit()->initializeFrom(ir);
}
Exemplo n.º 2
0
IRResultType
SpoolesSolver :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    int val;
    std::string msgFileName;

    val = -3;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_SpoolesSolver_msglvl);
    msglvl = val;
    IR_GIVE_OPTIONAL_FIELD(ir, msgFileName, _IFT_SpoolesSolver_msgfile);
    if ( !msgFileName.empty() ) {
        msgFile = fopen(msgFileName.c_str(), "w");
        msgFileCloseFlag = 1;
    } else {
        msgFile = stdout;
        msgFileCloseFlag = 0;
    }

    /*
     * IR_GIVE_OPTIONAL_FIELD (ir, tol, "lstol");
     * IR_GIVE_OPTIONAL_FIELD (ir, maxite, "lsiter");
     * val = 0;
     * IR_GIVE_OPTIONAL_FIELD (ir, val, "lsprecond");
     * precondType= (IMLPrecondType) val;
     *
     * this->precondAttributes = ir;
     */
    return IRRT_OK;
}
Exemplo n.º 3
0
// reads the model parameters from the input file
IRResultType
MisesMat :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                 // required by IR_GIVE_FIELD macro

    result = StructuralMaterial :: initializeFrom(ir);
    if ( result != IRRT_OK ) return result;

    result = linearElasticMaterial->initializeFrom(ir); // takes care of elastic constants
    if ( result != IRRT_OK ) return result;

    G = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveShearModulus();
    K = static_cast< IsotropicLinearElasticMaterial * >(linearElasticMaterial)->giveBulkModulus();

    IR_GIVE_FIELD(ir, sig0, _IFT_MisesMat_sig0); // uniaxial yield stress

    H = 0.;
    IR_GIVE_OPTIONAL_FIELD(ir, H, _IFT_MisesMat_h); // hardening modulus
    /*********************************************************************************************************/
    omega_crit = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, omega_crit, _IFT_MisesMat_omega_crit); // critical damage

    a = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, a, _IFT_MisesMat_a); // exponent in damage law
    /********************************************************************************************************/

    return IRRT_OK;
}
Exemplo n.º 4
0
IRResultType
TR_SHELL01 :: initializeFrom(InputRecord *ir)
{
    // proc tady neni return = this...   ??? termitovo
    IRResultType result = StructuralElement :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

#if 0
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_Element_nip);
    if ( val != -1 ) {
        OOFEM_WARNING("key word NIP is not allowed for element TR_SHELL01");
        return result;
    }
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_TrPlaneStrRot_niprot, "niprot");
    if ( val != -1 ) {
        OOFEM_WARNING("key word NIProt is not allowed for element TR_SHELL01");
        return result;
    }
#endif

    result = plate->initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }
    result = membrane->initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

    return IRRT_OK;
}
Exemplo n.º 5
0
IRResultType
SolutionbasedShapeFunction :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    // Load problem file
    this->filename = "";
    IR_GIVE_OPTIONAL_FIELD(ir, this->filename, _IFT_SolutionbasedShapeFunction_ShapeFunctionFile);
    useConstantBase = ( this->filename == "" ) ? true : false;

    externalSet = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, externalSet, _IFT_SolutionbasedShapeFunction_Externalset);

    // use correction factors to ensure incompressibility
    useCorrectionFactors=false;
    IR_GIVE_OPTIONAL_FIELD(ir, useCorrectionFactors, _IFT_SolutionbasedShapeFunction_UseCorrectionFactors);

    dumpSnapshot = false;
    IR_GIVE_OPTIONAL_FIELD(ir, dumpSnapshot, _IFT_SolutionbasedShapeFunction_DumpSnapshots);


    // Set up master dofs
    ///@todo This should be in the constructor:
    myNode = new Node( 1, this->giveDomain() );

    for (int i = 1; i <= this->giveDomain()->giveNumberOfSpatialDimensions(); i++) {
        int DofID = this->domain->giveNextFreeDofID();
        MasterDof *newDof = new MasterDof( myNode, (DofIDItem) DofID );
        myNode->appendDof( newDof );
    }

    init();

    return ActiveBoundaryCondition :: initializeFrom(ir);
}
Exemplo n.º 6
0
IRResultType XfemStructureManager :: initializeFrom(InputRecord *ir)
{
    IRResultType result; // Required by IR_GIVE_FIELD macro
    int splitCracks = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, splitCracks, _IFT_XfemStructureManager_splitCracks);
    if ( splitCracks == 1 ) {
        mSplitCracks = true;
    }

    int nonStdCz = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, nonStdCz, _IFT_XfemStructureManager_nonstandardCZ);
    if ( nonStdCz == 1 ) {
    	mNonstandardCz = true;
    }

    IR_GIVE_OPTIONAL_FIELD(ir, mMinCrackLength, _IFT_XfemStructureManager_minCrackLength);

//    if(mMinCrackLength < 1.0e-12) {
//    	printf("mMinCrackLength: %e\n", mMinCrackLength);
//    }

    IR_GIVE_OPTIONAL_FIELD(ir, mCrackMergeTol, _IFT_XfemStructureManager_crackMergeTol);

    if(mCrackMergeTol > 1.0e-12) {
    	printf("mCrackMergeTol: %e\n", mCrackMergeTol);
    }

    return XfemManager :: initializeFrom(ir);
}
Exemplo n.º 7
0
IRResultType StokesFlow :: initializeFrom(InputRecord *ir)
{
    IRResultType result;
    int val;

    val = ( int ) SMT_PetscMtrx;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    this->sparseMtrxType = ( SparseMtrxType ) val;

    val = ( int ) ST_Petsc;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    this->solverType = ( LinSystSolverType ) val;

    this->deltaT = 1.0;
    IR_GIVE_OPTIONAL_FIELD(ir, deltaT, _IFT_StokesFlow_deltat);

    this->velocityPressureField.reset( new DofDistributedPrimaryField(this, 1, FT_VelocityPressure, 1) );
    this->stiffnessMatrix.reset( NULL );
    this->meshqualityee.reset( NULL );

    this->ts = TS_OK;

    this->maxdef = 25; ///@todo Deal with this parameter (set to some reasonable value by default now)

    return FluidModel :: initializeFrom(ir);
}
Exemplo n.º 8
0
IRResultType
FreeWarping :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    result = StructuralEngngModel :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

    int val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    solverType = ( LinSystSolverType ) val;

    val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    sparseMtrxType = ( SparseMtrxType ) val;

#ifdef __PARALLEL_MODE
    if ( isParallel() ) {
        commBuff = new CommunicatorBuff( this->giveNumberOfProcesses() );
        communicator = new NodeCommunicator(this, commBuff, this->giveRank(),
                                            this->giveNumberOfProcesses());
    }

#endif


    return IRRT_OK;
}
Exemplo n.º 9
0
IRResultType
EigenValueDynamic :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    //EngngModel::instanciateFrom (ir);

    IR_GIVE_FIELD(ir, numberOfRequiredEigenValues, IFT_EigenValueDynamic_nroot, "nroot"); // Macro

    // numberOfSteps set artificially to numberOfRequiredEigenValues
    // in order to allow
    // use restoreContext function for different eigenValues
    // numberOfSteps = numberOfRequiredEigenValues;
    numberOfSteps = 1;

    IR_GIVE_FIELD(ir, rtolv, IFT_EigenValueDynamic_rtolv, "rtolv"); // Macro
    if ( rtolv < 1.e-12 ) {
        rtolv =  1.e-12;
    }

    if ( rtolv > 0.01 ) {
        rtolv =  0.01;
    }

    int val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, IFT_EigenValueDynamic_stype, "stype"); // Macro
    solverType = ( GenEigvalSolverType ) val;

    val = 0; //Default Skyline
    IR_GIVE_OPTIONAL_FIELD(ir, val, IFT_EigenValueDynamic_smtype, "smtype");  // Macro
    sparseMtrxType = ( SparseMtrxType ) val;

    return IRRT_OK;
}
Exemplo n.º 10
0
IRResultType
J2plasticMaterial :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    double value;

    PlasticMaterial :: initializeFrom(ir);
    linearElasticMaterial->initializeFrom(ir);

    IR_GIVE_FIELD(ir, value, IFT_J2plasticMaterial_ry, "ry"); // Macro
    k = value / sqrt(3.0);

    //  E = readDouble (initString,"e");
    // nu = readDouble (initString,"nu");
    kinematicModuli = 0.0;
    IR_GIVE_OPTIONAL_FIELD(ir, kinematicModuli, IFT_J2plasticMaterial_khm, "khm"); // Macro

    isotropicModuli = 0.0;
    IR_GIVE_OPTIONAL_FIELD(ir, isotropicModuli, IFT_J2plasticMaterial_ihm, "ihm"); // Macro

    if ( fabs(kinematicModuli) > 1.e-12 ) {
        kinematicHardeningFlag = 1;
    }

    if ( fabs(isotropicModuli) > 1.e-12 ) {
        isotropicHardeningFlag = 1;
    }

    return IRRT_OK;
}
Exemplo n.º 11
0
IRResultType
TrustRegionSolver3 :: initializeFrom(InputRecord *ir) {

    IRResultType result;                // Required by IR_GIVE_FIELD macro


    IR_GIVE_OPTIONAL_FIELD(ir, mTrustRegionSize, _IFT_TrustRegionSolver3_InitialSize);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mTrustRegionSize: %e\n", mTrustRegionSize);
	}


    IR_GIVE_OPTIONAL_FIELD(ir, mBeta, _IFT_TrustRegionSolver3_Beta);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mBeta: %e\n", mBeta);
	}


    IR_GIVE_OPTIONAL_FIELD(ir, mEigVecRecalc, _IFT_TrustRegionSolver3_EigVecRecompute);

	if ( engngModel->giveProblemScale() == macroScale ) {
		printf("mEigVecRecalc: %d\n", mEigVecRecalc);
	}

    return NRSolver :: initializeFrom(ir);

}
IRResultType
BilinearCZMaterial :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom";  // Required by IR_GIVE_FIELD macro
    IRResultType result;                    // Required by IR_GIVE_FIELD macro

    IR_GIVE_FIELD(ir, kn0, _IFT_BilinearCZMaterial_kn);
    this->knc = kn0;                        // Defaults to the same stiffness in compression and tension
    IR_GIVE_OPTIONAL_FIELD(ir, this->knc, _IFT_BilinearCZMaterial_knc);
    
    this->ks0 = 0.0;                        // Defaults to no shear stiffness
    IR_GIVE_OPTIONAL_FIELD(ir, ks0, _IFT_BilinearCZMaterial_ks);

    IR_GIVE_FIELD(ir, GIc, _IFT_BilinearCZMaterial_g1c);

    this->sigfn = 1.0e50; // defaults to infinite strength @todo but then it will not be bilinear only linear
    this->sigfs = 1.0e50;
    IR_GIVE_OPTIONAL_FIELD(ir, sigfn, _IFT_BilinearCZMaterial_sigfn);

    this->gn0 = sigfn / (kn0 + tolerance);                   // normal jump at damage initiation 
    this->gs0 = sigfs / (ks0 + tolerance);                   // shear jump at damage initiation
    this->gnmax = 2.0 * GIc / sigfn;                         // @todo defaults to zero - will this cause problems?
    this->kn1 = - this->sigfn / ( this->gnmax - this->gn0 ); // slope during softening part in normal dir
    double kn0min = 0.5*sigfn*sigfn/GIc;
    this->checkConsistency();                                // check validity of the material paramters
    this->printYourself();
    return IRRT_OK;
}
Exemplo n.º 13
0
IRResultType IncrementalLinearStatic :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    IR_GIVE_OPTIONAL_FIELD(ir, discreteTimes, _IFT_IncrementalLinearStatic_prescribedtimes);
    if ( discreteTimes.giveSize() > 0 ) {
        numberOfSteps = discreteTimes.giveSize();
        endOfTimeOfInterest = discreteTimes.at( discreteTimes.giveSize() );
        fixedSteps = false;
    } else {
        deltaT = 1.0;
        IR_GIVE_OPTIONAL_FIELD(ir, deltaT, _IFT_IncrementalLinearStatic_deltat);
        IR_GIVE_FIELD(ir, numberOfSteps, _IFT_EngngModel_nsteps);
        endOfTimeOfInterest = deltaT * numberOfSteps;
        fixedSteps = true;
    }
    IR_GIVE_OPTIONAL_FIELD(ir, endOfTimeOfInterest, _IFT_IncrementalLinearStatic_endoftimeofinterest);

    int val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    solverType = ( LinSystSolverType ) val;

    val = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    sparseMtrxType = ( SparseMtrxType ) val;

    //StructuralEngngModel::initializeFrom (ir);
    return IRRT_OK;
}
Exemplo n.º 14
0
IRResultType StokesFlow :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom";
    IRResultType result;
    int val;

    val = ( int ) SMT_PetscMtrx;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    this->sparseMtrxType = ( SparseMtrxType ) val;

    val = ( int ) ST_Petsc;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_lstype);
    this->solverType = ( LinSystSolverType ) val;

    this->deltaT = 1.0;
    IR_GIVE_OPTIONAL_FIELD(ir, deltaT, _IFT_StokesFlow_deltat);

    this->velocityPressureField = new PrimaryField(this, 1, FT_VelocityPressure, EID_MomentumBalance_ConservationEquation, 1);

    this->ts = TS_OK;

    this->maxdef = 25; ///@todo Deal with this parameter (set to some reasonable value by default now)

    return EngngModel :: initializeFrom(ir);
}
Exemplo n.º 15
0
IRResultType
SolutionbasedShapeFunction :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    ActiveBoundaryCondition :: initializeFrom(ir);

    // Load problem file
    this->filename = "";
    IR_GIVE_OPTIONAL_FIELD(ir, this->filename, _IFT_SolutionbasedShapeFunction_ShapeFunctionFile);
    useConstantBase = ( this->filename == "" ) ? true : false;

    externalSet = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, externalSet, _IFT_SolutionbasedShapeFunction_Externalset);

    // Set up master dofs
    myNode = new Node( 1, this->giveDomain() );

    for ( int i = 1; i <= this->giveDofIDs().giveSize(); i++ ) {
        int DofID = this->domain->giveNextFreeDofID();
        MasterDof *newDof = new MasterDof(i, myNode, ( DofIDItem ) DofID);
        myNode->appendDof(newDof);
        myDofIDs.followedBy(DofID);
    }

    init();

    return IRRT_OK;
}
Exemplo n.º 16
0
IRResultType
MisesMatNl :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    MisesMat :: initializeFrom(ir);
    StructuralNonlocalMaterialExtensionInterface :: initializeFrom(ir);

    averType = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, averType, _IFT_MisesMatNl_averagingtype);
    if ( averType == 2 ) {
        exponent = 0.5; // default value for averaging type 2
    }

    if ( averType == 3 ) {
        exponent = 1.; // default value for averaging type 3
    }

    if ( averType == 2 || averType == 3 ) {
        IR_GIVE_OPTIONAL_FIELD(ir, exponent, _IFT_MisesMatNl_exp);
    }

    if ( averType >= 2 && averType <= 5 ) {
        IR_GIVE_OPTIONAL_FIELD(ir, Rf, _IFT_MisesMatNl_rf);
    }

    return IRRT_OK;
}
Exemplo n.º 17
0
IRResultType
Q4Axisymm :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    this->StructuralElement :: initializeFrom(ir);
    numberOfGaussPoints          = 4;
    IR_GIVE_OPTIONAL_FIELD(ir, numberOfGaussPoints, IFT_Q4Axisymm_nip, "nip"); // Macro
    numberOfFiAndShGaussPoints   = 1;
    IR_GIVE_OPTIONAL_FIELD(ir, numberOfFiAndShGaussPoints, IFT_Q4Axisymm_nipfish, "nipfish"); // Macro

    if ( !( ( numberOfGaussPoints == 1 ) ||
           ( numberOfGaussPoints == 4 ) ||
           ( numberOfGaussPoints == 9 ) ||
           ( numberOfGaussPoints == 16 ) ) ) {
        numberOfGaussPoints = 4;
    }

    if ( !( ( numberOfFiAndShGaussPoints == 1 ) ||
           ( numberOfFiAndShGaussPoints == 4 ) ||
           ( numberOfFiAndShGaussPoints == 9 ) ||
           ( numberOfFiAndShGaussPoints == 16 ) ) ) {
        numberOfFiAndShGaussPoints = 1;
    }


    this->computeGaussPoints();

    return IRRT_OK;
}
Exemplo n.º 18
0
IRResultType
SparseNonLinearSystemNM :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    randPertAmplitude = 0.;
    IR_GIVE_OPTIONAL_FIELD(ir, randPertAmplitude, _IFT_NonLinearStatic_randPertAmplitude);
    if ( randPertAmplitude < 0. ) {
        OOFEM_WARNING("Random pertubation amplitude can not be negative");
        return IRRT_BAD_FORMAT;
    }
    randSeed = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, randSeed, _IFT_NonLinearStatic_randSeed);
 
    // optional parameters related to perturbations of the initial guess (first iteration)
    igp_PertDmanDofSrcArray.clear();
    IR_GIVE_OPTIONAL_FIELD(ir, igp_PertDmanDofSrcArray, _IFT_NonLinearStatic_pert);
    igp_PertWeightArray.clear();
    IR_GIVE_OPTIONAL_FIELD(ir, igp_PertWeightArray, _IFT_NonLinearStatic_pertw);
    if ( igp_PertDmanDofSrcArray.giveSize() ) {
        if ( ( igp_PertDmanDofSrcArray.giveSize() % 2 ) != 0 ) {
            OOFEM_WARNING("Pert map size must be an even number, it contains pairs <node, nodeDof>");
            return IRRT_BAD_FORMAT;
        }
        int nsize = igp_PertDmanDofSrcArray.giveSize() / 2;
        if ( igp_PertWeightArray.giveSize() != nsize ) {
            OOFEM_WARNING("Pert map size and weight array size mismatch");
            return IRRT_BAD_FORMAT;
        }
        pert_init_needed = true;
    } else {
        pert_init_needed = false;
    }
    return IRRT_OK;
}
Exemplo n.º 19
0
IRResultType
BondCEBMaterial :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    // mandatory parameters
    IR_GIVE_FIELD(ir, kn, _IFT_BondCEBMaterial_kn);
    IR_GIVE_FIELD(ir, ks, _IFT_BondCEBMaterial_ks);
    IR_GIVE_FIELD(ir, s1, _IFT_BondCEBMaterial_s1);
    IR_GIVE_FIELD(ir, s2, _IFT_BondCEBMaterial_s2);
    IR_GIVE_FIELD(ir, s3, _IFT_BondCEBMaterial_s3);
    IR_GIVE_FIELD(ir, taumax, _IFT_BondCEBMaterial_taumax);

    // optional parameters
    IR_GIVE_OPTIONAL_FIELD(ir, tauf, _IFT_BondCEBMaterial_tauf);
    IR_GIVE_OPTIONAL_FIELD(ir, alpha, _IFT_BondCEBMaterial_al);

    // dependent parameter
    s0 = pow(pow(s1,-alpha)*taumax/ks,1./(1.-alpha));
    if (s0>s1) {
      s0 = s1;
      ks = taumax/s1;
      OOFEM_WARNING("Parameter ks adjusted");
    }

    return StructuralMaterial :: initializeFrom(ir);
}
Exemplo n.º 20
0
IRResultType
HydrationModel :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                            // Required by IR_GIVE_FIELD macro
    double value;

    //hydration>0  ->  initial hydration degree
    initialHydrationDegree = 0.;
    IR_GIVE_OPTIONAL_FIELD(ir, initialHydrationDegree, _IFT_HydrationModel_hydration);
    if ( initialHydrationDegree >= 0. ) {
        OOFEM_LOG_INFO("HydrationModel: Hydration from %.2f.", initialHydrationDegree);
    } else {
        OOFEM_WARNING("Hydration degree input incorrect, use 0..1 to set initial material hydration degree.");
        return IRRT_BAD_FORMAT;
    }

    if ( ir->hasField(_IFT_HydrationModel_c60mix) ) {
        OOFEM_LOG_INFO("HydrationModel: Model parameters for Skanska C60/75 mixture.");
        setMixture(mtC60);
    }

    timeScale = 1.;
    value = -1.;
    IR_GIVE_OPTIONAL_FIELD(ir, value, _IFT_HydrationModel_timeScale);
    if ( value >= 0. ) {
        timeScale = value;
        OOFEM_LOG_INFO("HydrationModel: Time scale set to %.0f", timeScale);
    }

    // Optional direct input of material parameters
    le = 0;
    value = -1.;
    IR_GIVE_OPTIONAL_FIELD(ir, value, _IFT_HydrationModel_hheat);
    if ( value >= 0 ) {
        le = value;
        OOFEM_LOG_INFO("HydrationModel: Latent heat of hydration set to %.0f", le);
    }

    value = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, value, _IFT_HydrationModel_cv);
    if ( value >= 0 ) {
        cv = value;
        OOFEM_LOG_INFO("HydrationModel: Cement content set to %.0f kg/m3", cv);
        we = 0.23 * cv;
    }

    value = -1.;
    IR_GIVE_OPTIONAL_FIELD(ir, value, _IFT_HydrationModel_water);
    if ( value >= 0 ) {
        we = value;
    }

    if ( cv || ( value >= 0 ) ) {
        OOFEM_LOG_INFO("HydrationModel: Water consumption for hydration set to %.0f kg/m3", we);
    }

    return IRRT_OK;
}
Exemplo n.º 21
0
IRResultType AbaqusUserMaterial :: initializeFrom(InputRecord *ir)
{
    IRResultType result;
    std :: string umatname;

    result = StructuralMaterial :: initializeFrom(ir);
    if ( result != IRRT_OK ) return result;

    IR_GIVE_FIELD(ir, this->numState, _IFT_AbaqusUserMaterial_numState);
    IR_GIVE_FIELD(ir, this->properties, _IFT_AbaqusUserMaterial_properties);
    IR_GIVE_FIELD(ir, this->filename, _IFT_AbaqusUserMaterial_userMaterial);
    umatname = "umat";
    IR_GIVE_OPTIONAL_FIELD(ir, umatname, _IFT_AbaqusUserMaterial_name);
    strncpy(this->cmname, umatname.c_str(), 80);
    IR_GIVE_OPTIONAL_FIELD(ir, this->initialStress, _IFT_AbaqusUserMaterial_initialStress);

#ifdef _WIN32
    ///@todo Check all the windows support.
    this->umatobj = ( void * ) LoadLibrary( filename.c_str() );
    if ( !this->umatobj ) {
        DWORD dlresult = GetLastError(); //works for MinGW 32bit and MSVC
        OOFEM_ERROR("Couldn't load \"%s\",\nerror code = %d", filename.c_str(), dlresult);
    }

    //     * ( void ** )( & this->umat ) = GetProcAddress( ( HMODULE ) this->umatobj, "umat_" );
    * ( FARPROC * ) ( & this->umat ) = GetProcAddress( ( HMODULE ) this->umatobj, "umat_" ); //works for MinGW 32bit
    if ( !this->umat ) {
        //         char *dlresult = GetLastError();
        DWORD dlresult = GetLastError(); //works for MinGW 32bit
        OOFEM_ERROR("Couldn't load symbol umat,\nerror code: %d\n", dlresult);
    }

#else
    this->umatobj = dlopen(filename.c_str(), RTLD_NOW);
    if ( !this->umatobj ) {
        OOFEM_ERROR("couldn't load \"%s\",\ndlerror: %s", filename.c_str(), dlerror() );
    }

    * ( void ** ) ( & this->umat ) = dlsym(this->umatobj, "umat_");

    char *dlresult = dlerror();
    if ( dlresult ) {
        OOFEM_ERROR("couldn't load symbol umat,\ndlerror: %s\n", dlresult);
    }

#endif

    if ( ir->hasField(_IFT_AbaqusUserMaterial_numericalTangent) ) {
        mUseNumericalTangent = true;
    }

    if ( ir->hasField(_IFT_AbaqusUserMaterial_numericalTangentPerturbation) ) {
        IR_GIVE_OPTIONAL_FIELD(ir, mPerturbation, _IFT_AbaqusUserMaterial_numericalTangentPerturbation);
        printf("mPerturbation: %e\n", mPerturbation);
    }

    return IRRT_OK;
}
Exemplo n.º 22
0
IRResultType
MazarsMaterial :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro
    int ver;

    // Note: IsotropicDamageMaterial1 :: initializeFrom is not activated
    // because we do not always read ef and the equivalent strain type
    // cannot be selected
    // IsotropicDamageMaterial1 :: initializeFrom(ir);

    this->equivStrainType = EST_Mazars;

    IsotropicDamageMaterial :: initializeFrom(ir);
    RandomMaterialExtensionInterface :: initializeFrom(ir);

    linearElasticMaterial->initializeFrom(ir);
    // E and nu are made available for direct access
    IR_GIVE_FIELD(ir, E, _IFT_IsotropicLinearElasticMaterial_e);
    IR_GIVE_FIELD(ir, nu, _IFT_IsotropicLinearElasticMaterial_n);

    ver = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, ver, _IFT_MazarsMaterial_version);
    if ( ver == 1 ) {
        this->modelVersion = maz_modTension;
    } else if ( ver == 0 ) {
        this->modelVersion = maz_original;
    } else {
        OOFEM_ERROR("unknown version");
    }

    IR_GIVE_FIELD(ir, this->e0, _IFT_MazarsMaterial_e0);
    IR_GIVE_FIELD(ir, this->Ac, _IFT_MazarsMaterial_ac);

    this->Bc = ( Ac - 1.0 ) / ( Ac * e0 ); // default value, ensures smooth curve
    IR_GIVE_OPTIONAL_FIELD(ir, this->Bc, _IFT_MazarsMaterial_bc);

    beta = 1.06;
    IR_GIVE_OPTIONAL_FIELD(ir, beta, _IFT_MazarsMaterial_beta);

    if ( this->modelVersion == maz_original ) {
        IR_GIVE_FIELD(ir, this->At, _IFT_MazarsMaterial_at);
        IR_GIVE_FIELD(ir, this->Bt, _IFT_MazarsMaterial_bt);
    } else if ( this->modelVersion == maz_modTension ) {
        // in case of modified model read ef instead of At, Bt
        IR_GIVE_FIELD(ir, this->ef, _IFT_MazarsMaterial_ef);
    }

    // ask for optional "reference length"
    hReft = hRefc = 0.; // default values 0 => no adjustment for element size is used
    IR_GIVE_OPTIONAL_FIELD(ir, this->hReft, _IFT_MazarsMaterial_hreft);
    IR_GIVE_OPTIONAL_FIELD(ir, this->hRefc, _IFT_MazarsMaterial_hrefc);

    this->mapper.initializeFrom(ir);

    return IRRT_OK;
}
Exemplo n.º 23
0
IRResultType PrescribedGradientBCWeak :: initializeFrom(InputRecord *ir)
{
    IRResultType result;
    result = ActiveBoundaryCondition :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }
    result = PrescribedGradientHomogenization :: initializeFrom(ir);
    if ( result != IRRT_OK ) {
        return result;
    }

    IR_GIVE_FIELD(ir, mTractionInterpOrder, _IFT_PrescribedGradientBCWeak_TractionInterpOrder);
//    printf("mTractionInterpOrder: %d\n", mTractionInterpOrder);

    IR_GIVE_FIELD(ir, mNumTractionNodesAtIntersections, _IFT_PrescribedGradientBCWeak_NumTractionNodesAtIntersections);
//    printf("mNumTractionNodesAtIntersections: %d\n", mNumTractionNodesAtIntersections);

    if ( mNumTractionNodesAtIntersections > 1 && mTractionInterpOrder == 0 ) {
        OOFEM_ERROR("mNumTractionNodesAtIntersections > 1 is not allowed if mTractionInterpOrder == 0.")
    }

    IR_GIVE_FIELD(ir, mTractionNodeSpacing, _IFT_PrescribedGradientBCWeak_NumTractionNodeSpacing);
//    printf("mTractionNodeSpacing: %d\n", mTractionNodeSpacing);

    int duplicateCorners = 0;
    IR_GIVE_FIELD(ir, duplicateCorners, _IFT_PrescribedGradientBCWeak_DuplicateCornerNodes);
//    printf("duplicateCorners: %d\n", duplicateCorners);

    if ( duplicateCorners == 1 ) {
        mDuplicateCornerNodes = true;
    } else   {
        mDuplicateCornerNodes = false;
    }

    mTangDistPadding = 0.0;
    IR_GIVE_OPTIONAL_FIELD(ir, mTangDistPadding, _IFT_PrescribedGradientBCWeak_TangDistPadding);
//    printf("mTangDistPadding: %e\n", mTangDistPadding);

    IR_GIVE_OPTIONAL_FIELD(ir, mTracDofScaling, _IFT_PrescribedGradientBCWeak_TracDofScaling);
//    printf("mTracDofScaling: %e\n", mTracDofScaling );

    IR_GIVE_OPTIONAL_FIELD(ir, mPeriodicityNormal, _IFT_PrescribedGradientBCWeak_PeriodicityNormal);
    mPeriodicityNormal.normalize();
//    printf("mPeriodicityNormal: "); mPeriodicityNormal.printYourself();


    IR_GIVE_OPTIONAL_FIELD(ir, mMirrorFunction, _IFT_PrescribedGradientBCWeak_MirrorFunction);
//    printf("mMirrorFunction: %d\n", mMirrorFunction );

    if(mMirrorFunction == 0) {
    	mPeriodicityNormal = {0.0, 1.0};
    }

    return IRRT_OK;
}
Exemplo n.º 24
0
IRResultType
CohesiveSurface3d :: initializeFrom(InputRecord *ir)
{
    IRResultType result;

    // first call parent
    StructuralElement :: initializeFrom(ir);

    // read the area from the input file
    IR_GIVE_FIELD(ir, area, _IFT_CohSur3d_area);
    if ( area < 0. ) {
        OOFEM_ERROR("negative area specified");
    }

    // read shift constants of second (periodic) particle form the input file (if defined)
    ///@todo Why not a vector input instead?
    IR_GIVE_OPTIONAL_FIELD(ir, kx, _IFT_CohSur3d_kx);
    IR_GIVE_OPTIONAL_FIELD(ir, ky, _IFT_CohSur3d_ky);
    IR_GIVE_OPTIONAL_FIELD(ir, kz, _IFT_CohSur3d_kz);

    // evaluate number of Dof Managers
    numberOfDofMans = dofManArray.giveSize();
    if ( numberOfDofMans <= 0 ) {
        OOFEM_ERROR("unread nodes: Element %d", this->giveNumber() );
    }

    if ( ( numberOfDofMans == 3 ) & ( kx == 0 ) & ( ky == 0 ) & ( kz == 0 ) ) {
        OOFEM_ERROR("no periodic shift defined: Element %d", this->giveNumber() );
    }


    // shifts of periodic particles
    if ( numberOfDofMans == 3 ) {
        Node *nodeC;
        nodeC  = this->giveNode(3);
        kxa = this->kx * nodeC->giveCoordinate(1);
        kyb = this->ky * nodeC->giveCoordinate(2);
        kzc = this->kz * nodeC->giveCoordinate(3);
    }

    // evaluate the length
    giveLength();
    if ( length <= 0. ) {
        OOFEM_ERROR("negative length evaluated: Element %d", this->giveNumber() )

        // evaluate the coordinates of the center
        evaluateCenter();
    }

    // evaluate the local coordinate system
    evaluateLocalCoordinateSystem();

    return IRRT_OK;
}
Exemplo n.º 25
0
IRResultType HangingNode :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                   // Required by IR_GIVE_FIELD macro

    Node :: initializeFrom(ir);
    this->masterElement = -1;
    IR_GIVE_OPTIONAL_FIELD(ir, this->masterElement, _IFT_HangingNode_masterElement);
    this->masterRegion = 0;
    IR_GIVE_OPTIONAL_FIELD(ir, this->masterRegion, _IFT_HangingNode_masterRegion);
    return IRRT_OK;
}
Exemplo n.º 26
0
IRResultType
HydratingIsoHeatMaterial :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                   // Required by IR_GIVE_FIELD macro
    int value;
    double dvalue;

    // set k, c - necessary; rc beton Hellmich 2428 kJ/m3
    result = IsotropicHeatTransferMaterial :: initializeFrom(ir);
    if ( result != IRRT_OK ) return result;

    // setup hydration model
    result = HydrationModelInterface :: initializeFrom(ir);
    if ( result != IRRT_OK ) return result;

    dvalue = -2.;
    IR_GIVE_OPTIONAL_FIELD(ir, dvalue, _IFT_HydratingIsoHeatMaterial_hydration);
    if ( dvalue >= 0. ) {
        hydration = 1;
    } else {
        hydration = 0;
    }

    if ( hydration ) {
        // mixture type: 1 - mtLafarge, 2 - mtHuber, 3 - mtC60
        value = 0;
        IR_GIVE_OPTIONAL_FIELD(ir, value, _IFT_HydratingIsoHeatMaterial_mix);
        if ( !value ) {
            value = mtLafarge;
        }

        setMixture( ( MixtureType ) value );
        printf("\nHydratingHeatMat %d: using mixture %d.\n", giveNumber(), value);

        if ( ir->hasField(_IFT_HydratingIsoHeatMaterial_noHeat) ) {
            hydrationHeat = 0;
            printf( "HydratingHeatMat %d: hydration heat neglected.\n", giveNumber() );
        } else {
            hydrationHeat = 1;
        }

        if ( hydrationHeat ) {
            // include hydration internal source in LHS?
            if ( ir->hasField(_IFT_HydratingIsoHeatMaterial_noLHS) ) {
                hydrationLHS = 0;
                printf( "HydratingHeatMat %d: hydration heat not included in LHS.\n", giveNumber() );
            } else {
                hydrationLHS = 1;
            }
        }
    }

    return IRRT_OK;
}
Exemplo n.º 27
0
NumericalMethod *NonLinearStatic :: giveNumericalMethod(MetaStep *mStep)
{
    const char *__proc = "giveNumericalMethod"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                     // Required by IR_GIVE_FIELD macro

    if ( mStep == NULL ) {
        _error("giveNumericalMethod: undefined meta step");
    }

    int _val = 0;
    IR_GIVE_OPTIONAL_FIELD( ( mStep->giveAttributesRecord() ), _val, IFT_NonLinearStatic_controlmode, "controlmode" ); // Macro
    IR_GIVE_OPTIONAL_FIELD( ( mStep->giveAttributesRecord() ), _val, IFT_NonLinearStatic_controlmode, "controllmode" ); // for backward compatibility
    NonLinearStatic_controlType mode = ( NonLinearStatic_controlType ) _val;

    SparseNonLinearSystemNM *nm = NULL;
    if ( mode == nls_indirectControl ) {
        if ( nMethod ) {
            if ( nMethod->giveClassID() == CylindricalALMSolverClass ) {
                return nMethod;
            } else {
                delete nMethod;
            }
        }

        nm = ( SparseNonLinearSystemNM * ) new CylindricalALM(1, this->giveDomain(1), this, EID_MomentumBalance);
        nMethod = nm;
    } else if ( mode == nls_directControl ) {
        if ( nMethod ) {
            if ( nMethod->giveClassID() == NRSolverClass ) {
                return nMethod;
            } else {
                delete nMethod;
            }
        }

        nm = ( SparseNonLinearSystemNM * ) new NRSolver(1, this->giveDomain(1), this, EID_MomentumBalance);
        nMethod = nm;
    } else if ( mode == nls_directControl2 ) {
        if ( nMethod ) {
            if ( nMethod->giveClassID() == NRSolverClass ) {
                return nMethod;
            } else {
                delete nMethod;
            }
        }

        nm = ( SparseNonLinearSystemNM * ) new NRSolver2(1, this->giveDomain(1), this, EID_MomentumBalance);
        nMethod = nm;
    } else {
        _error("giveNumericalMethod: unsupported controlMode");
    }

    return nm;
}
IRResultType
UserDefinedLoadTimeFunction :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom";
    IRResultType result;

    IR_GIVE_FIELD(ir, ftExpression, _IFT_UserDefinedLoadTimeFunction_ft);
    IR_GIVE_OPTIONAL_FIELD(ir, dfdtExpression, _IFT_UserDefinedLoadTimeFunction_dfdt);
    IR_GIVE_OPTIONAL_FIELD(ir, d2fdt2Expression, _IFT_UserDefinedLoadTimeFunction_d2fdt2);

    return LoadTimeFunction :: initializeFrom(ir);
}
Exemplo n.º 29
0
IRResultType
IsotropicHeatTransferMaterial :: initializeFrom(InputRecord *ir)
{
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    IR_GIVE_FIELD(ir, conductivity, _IFT_IsotropicHeatTransferMaterial_k);
    IR_GIVE_FIELD(ir, capacity, _IFT_IsotropicHeatTransferMaterial_c);
    IR_GIVE_OPTIONAL_FIELD(ir, maturityT0, _IFT_IsotropicHeatTransferMaterial_maturityT0);
    IR_GIVE_OPTIONAL_FIELD(ir, density, _IFT_IsotropicHeatTransferMaterial_d);

    return Material :: initializeFrom(ir);
}
IRResultType
StationaryTransportProblem :: initializeFrom(InputRecord *ir)
{
    const char *__proc = "initializeFrom"; // Required by IR_GIVE_FIELD macro
    IRResultType result;                // Required by IR_GIVE_FIELD macro

    EngngModel :: initializeFrom(ir);

    int val = SMT_Skyline;
    IR_GIVE_OPTIONAL_FIELD(ir, val, _IFT_EngngModel_smtype);
    this->sparseMtrxType = ( SparseMtrxType ) val;

    ///@todo Combine this option with structural problems, where it is possible to keep the secant tangent elastic tangent (or generally, the initial tangent) etc. One option should fit all common needs here.
    this->keepTangent = ir->hasField(_IFT_StationaryTransportProblem_keepTangent);

    // read field export flag
    IntArray exportFields;
    exportFields.resize(0);
    IR_GIVE_OPTIONAL_FIELD(ir, exportFields, _IFT_StationaryTransportProblem_exportfields);
    if ( exportFields.giveSize() ) {
        IntArray mask(1);
        FieldManager *fm = this->giveContext()->giveFieldManager();
        for ( int i = 1; i <= exportFields.giveSize(); i++ ) {
            if ( exportFields.at(i) == FT_Temperature ) {
                mask.at(1) = T_f;
#ifdef FIELDMANAGER_USE_SHARED_PTR
		//std::tr1::shared_ptr<Field> _temperatureField = make_shared<MaskedPrimaryField>(FT_Temperature, this->UnknownsField, mask);
		std::tr1::shared_ptr<Field> _temperatureField (new MaskedPrimaryField(FT_Temperature, this->UnknownsField, mask));
		fm->registerField(_temperatureField, ( FieldType ) exportFields.at(i));
#else
                MaskedPrimaryField *_temperatureField = new MaskedPrimaryField(FT_Temperature, this->UnknownsField, mask);
                fm->registerField(_temperatureField, ( FieldType ) exportFields.at(i), true);
#endif
            } else if ( exportFields.at(i) == FT_HumidityConcentration ) {
                mask.at(1) = C_1;
#ifdef FIELDMANAGER_USE_SHARED_PTR
		//std::tr1::shared_ptr<Field> _temperatureField = make_shared<MaskedPrimaryField>(FT_Temperature, this->UnknownsField, mask);
		std::tr1::shared_ptr<Field> _concentrationField (new MaskedPrimaryField(FT_HumidityConcentration, this->UnknownsField, mask));
		fm->registerField(_concentrationField, ( FieldType ) exportFields.at(i));
#else
                MaskedPrimaryField *_concentrationField = new MaskedPrimaryField(FT_HumidityConcentration, this->UnknownsField, mask);
                fm->registerField(_concentrationField, ( FieldType ) exportFields.at(i), true);
#endif
            }
        }
    }

    if( UnknownsField == NULL ){ // can exist from nonstationary transport problem
        UnknownsField = new PrimaryField(this, 1, FT_TransportProblemUnknowns, EID_ConservationEquation, 0);
    }

    return IRRT_OK;
}