/*!\file FemModel.c * \brief: implementation of the FemModel object */ #ifdef HAVE_CONFIG_H #include "config.h" #else #error "Cannot compile with HAVE_CONFIG_H symbol! run configure first!" #endif #include "stdio.h" #include "../DataSet/DataSet.h" #include "../modules/ModelProcessorx/ModelProcessorx.h" #include "./objects.h" #include "../include/include.h" #include "../EnumDefinitions/EnumDefinitions.h" #include "../modules/modules.h" /*Object constructors and destructor*/ /*FUNCTION FemModel::constructor {{{1*/ FemModel::FemModel(ConstDataHandle IOMODEL,int in_solution_type,int* analyses, int nummodels){ /*intermediary*/ int i; IoModel* iomodel=NULL; int analysis_type; /*Initialize internal data: */ this->nummodels=nummodels; this->solution_type=in_solution_type; this->analysis_counter=nummodels-1; //point to last analysis_type carried out. this->results=new DataSet(); //not initialized by CreateDataSets /*Dynamically allocate whatever is a list of length nummodels: */ analysis_type_list=(int*)xmalloc(nummodels*sizeof(int)); m_Rmg=(Mat*)xmalloc(nummodels*sizeof(Mat)); m_Gmn=(Mat*)xmalloc(nummodels*sizeof(Mat)); m_nodesets=(NodeSets**)xmalloc(nummodels*sizeof(NodeSets*)); m_yg=(Vec*)xmalloc(nummodels*sizeof(Vec)); m_ys=(Vec*)xmalloc(nummodels*sizeof(Vec)); /*Initialize: */ for(i=0;ielements,&this->nodes,&this->vertices,&this->materials,&this->constraints,&this->loads,&this->parameters,IOMODEL,this->solution_type,nummodels,analyses); /*do the post-processing of the datasets to get an FemModel that can actually run analyses: */ for(i=0;iparameters->SetParam(analysis_counter,AnalysisCounterEnum); this->parameters->SetParam(analysis_type,AnalysisTypeEnum); } /*}}}1*/ /*FUNCTION FemModel::SetCurrentAnalysisAlias {{{1*/ void FemModel::SetCurrentAnalysisAlias(int base_analysis_type,int real_analysis_type){ /*Use base_analysis_type to setup the analysis counter, but the analysis type of the FemModel will remain * real_analysis_type. This means we are using the base_analysis_type settings to run a similar, compatible * analysis called real_analysis_type: */ int found=-1; for(int i=0;iparameters->SetParam(analysis_counter,AnalysisCounterEnum); this->parameters->SetParam(real_analysis_type,AnalysisTypeEnum); } /*}}}1*/