Ignore:
Timestamp:
01/02/19 20:33:39 (6 years ago)
Author:
Mathieu Morlighem
Message:

CHG: simplifying some functions now that nodes and loads are for one single analysis

File:
1 edited

Legend:

Unmodified
Added
Removed
  • issm/trunk-jpl/src/c/classes/FemModel.cpp

    r23586 r23587  
    352352                analysis_type=output->analysis_type_list[i];
    353353                output->SetCurrentConfiguration(analysis_type);
    354                 SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters,analysis_type);
    355                 NodesDofx(output->nodes_list[i],output->parameters,analysis_type);
     354                SpcNodesx(output->nodes_list[i],output->constraints_list[i],output->parameters);
     355                NodesDofx(output->nodes_list[i],output->parameters);
    356356                ConfigureObjectsx(output->elements,output->loads_list[i],output->nodes_list[i],output->vertices,output->materials,output->parameters);
    357357        }
     
    445445
    446446                if(VerboseMProcessor()) _printf0_("      resolving node constraints\n");
    447                 SpcNodesx(nodes,this->constraints,parameters,analysis_type_list[i]);
     447                SpcNodesx(nodes,this->constraints,parameters);
    448448
    449449                if(VerboseMProcessor()) _printf0_("      creating nodal degrees of freedom\n");
    450                 NodesDofx(nodes,parameters,analysis_type_list[i]);
     450                NodesDofx(nodes,parameters);
    451451        }
    452452
     
    525525                        analysis_type=this->analysis_type_list[i];
    526526                        SetCurrentConfiguration(analysis_type);
    527                         SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters,analysis_type);
    528                         NodesDofx(this->nodes_list[i],this->parameters,analysis_type);
     527                        SpcNodesx(this->nodes_list[i],this->constraints_list[i],this->parameters);
     528                        NodesDofx(this->nodes_list[i],this->parameters);
    529529                        ConfigureObjectsx(this->elements,this->loads_list[i],this->nodes_list[i],this->vertices,this->materials,this->parameters);
    530530                }
     
    12791279void FemModel::GetInputLocalMinMaxOnNodesx(IssmDouble** pmin,IssmDouble** pmax,IssmDouble* ug){/*{{{*/
    12801280
    1281         /*Get vector sizes for current configuration*/
    1282         int configuration_type;
    1283         this->parameters->FindParam(&configuration_type,ConfigurationTypeEnum);
    1284         int numnodes = this->nodes->NumberOfNodes(configuration_type);
    1285 
    12861281        /*Initialize output vectors*/
     1282        int numnodes = this->nodes->NumberOfNodes();
    12871283        IssmDouble* uLmin_local = xNew<IssmDouble>(numnodes);
    12881284        IssmDouble* uLmax_local = xNew<IssmDouble>(numnodes);
     
    25432539
    25442540        /*Second, constraints might be time dependent: */
    2545         SpcNodesx(nodes,constraints,parameters,config_type);
     2541        SpcNodesx(nodes,constraints,parameters);
    25462542
    25472543        /*Now, update degrees of freedoms: */
    2548         NodesDofx(nodes,parameters,config_type);
     2544        NodesDofx(nodes,parameters);
    25492545
    25502546}
     
    27252721
    27262722                ConfigureObjectsx(new_elements,this->loads,new_nodes_list[i],new_vertices,new_materials,this->parameters);
    2727                 SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters,analysis_type);
    2728                 NodesDofx(new_nodes_list[i],this->parameters,analysis_type);
     2723                SpcNodesx(new_nodes_list[i],new_constraints_list[i],this->parameters);
     2724                NodesDofx(new_nodes_list[i],this->parameters);
    27292725        }
    27302726
     
    44804476void FemModel::HydrologyEPLupdateDomainx(IssmDouble* pEplcount){ /*{{{*/
    44814477
    4482         Vector<IssmDouble>* mask                                                        = NULL;
    4483         Vector<IssmDouble>* recurence                           = NULL;
    4484         Vector<IssmDouble>* active                                              = NULL;
    4485         IssmDouble*         serial_mask                         = NULL;
    4486         IssmDouble*         serial_rec                          = NULL;
    4487         IssmDouble*         serial_active                       = NULL;
    4488         IssmDouble*         old_active        = NULL;
    4489         int*                eplzigzag_counter = NULL;
     4478        Vector<IssmDouble> *mask = NULL;
     4479        Vector<IssmDouble> *recurence = NULL;
     4480        Vector<IssmDouble> *active = NULL;
     4481        IssmDouble         *serial_mask       = NULL;
     4482        IssmDouble         *serial_rec        = NULL;
     4483        IssmDouble         *serial_active     = NULL;
     4484        IssmDouble         *old_active        = NULL;
     4485        int                *eplzigzag_counter = NULL;
    44904486        int                 eplflip_lock;
    44914487
    4492         HydrologyDCEfficientAnalysis* effanalysis = new HydrologyDCEfficientAnalysis();
    4493         HydrologyDCInefficientAnalysis* inefanalysis = new HydrologyDCInefficientAnalysis();
     4488        HydrologyDCEfficientAnalysis   *effanalysis  = new HydrologyDCEfficientAnalysis();
     4489        HydrologyDCInefficientAnalysis *inefanalysis = new HydrologyDCInefficientAnalysis();
    44944490
    44954491        /*Step 1: update mask, the mask might be extended by residual and/or using downstream sediment head*/
    4496         mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
    4497         recurence=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
     4492        int numnodes = this->nodes->NumberOfNodes();
     4493        mask=new Vector<IssmDouble>(numnodes);
     4494        recurence=new Vector<IssmDouble>(numnodes);
    44984495        this->parameters->FindParam(&eplzigzag_counter,NULL,EplZigZagCounterEnum);
    44994496        this->parameters->FindParam(&eplflip_lock,HydrologydcEplflipLockEnum);
     
    45044501                effanalysis->HydrologyEPLGetMask(mask,recurence,element);
    45054502        }
     4503
    45064504        /*check for changes and increment zigzag counter, change the mask if necessary*/
    45074505        recurence->Assemble();
     
    45304528        inefanalysis->ElementizeEplMask(this);
    45314529        /*Step 2: update node activity. If one element is connected to mask=1, all nodes are active*/
    4532         active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
     4530        active=new Vector<IssmDouble>(nodes->NumberOfNodes());
    45334531        for (int i=0;i<elements->Size();i++){
    45344532                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     
    45664564        /*Update dof indexings*/
    45674565        this->UpdateConstraintsx();
    4568 
    45694566}
    45704567/*}}}*/
     
    45834580        if(isthermal){
    45844581                /*Step 1: update mask, the mask correspond to thawed nodes (that have a meltingrate)*/
    4585                 mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
     4582                mask=new Vector<IssmDouble>(this->nodes->NumberOfNodes());
    45864583
    45874584                for (int i=0;i<elements->Size();i++){
     
    46044601
    46054602        /*get node mask coherent with element mask*/
    4606         active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCInefficientAnalysisEnum));
     4603        active=new Vector<IssmDouble>(nodes->NumberOfNodes());
    46074604        for (int i=0;i<elements->Size();i++){
    46084605                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
     
    46514648        /*update node activity. If one element is connected to mask=1, all nodes are active*/
    46524649        this->SetCurrentConfiguration(HydrologyDCEfficientAnalysisEnum);
    4653         active=new Vector<IssmDouble>(nodes->NumberOfNodes(HydrologyDCEfficientAnalysisEnum));
     4650        active=new Vector<IssmDouble>(nodes->NumberOfNodes());
    46544651        for (int i=0;i<elements->Size();i++){
    46554652                Element* element=xDynamicCast<Element*>(elements->GetObjectByOffset(i));
Note: See TracChangeset for help on using the changeset viewer.