Changeset 25486


Ignore:
Timestamp:
08/27/20 05:21:45 (5 years ago)
Author:
bdef
Message:

CHG:passing analysis_type to SetwiseNodeConnectivity to avoid overcalling FindParam

Location:
issm/trunk-jpl/src/c
Files:
3 edited

Legend:

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

    r25447 r25486  
    737737        Gauss* gauss=this->NewGauss(5);
    738738        while(gauss->next()){
     739
    739740                this->JacobianDeterminant(&Jdet,xyz_list,gauss);
    740741
     
    33943395}
    33953396/*}}}*/
    3396 void       Element::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum){/*{{{*/
     3397void       Element::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum, int analysis_type){/*{{{*/
    33973398
    33983399        /*Intermediaries*/
     
    34053406        /*Loop over all nodes*/
    34063407        for(int i=0;i<numnodes;i++){
    3407 
    34083408                int nodelid = this->nodes[i]->Lid();
    34093409                if(!flags[nodelid]){
    3410 
    34113410                        /*flag current node so that no other element processes it*/
    34123411                        flags[nodelid]=true;
     
    34483447        /*Special case: 2d/3d coupling, the node of this element might be connected
    34493448         *to the basal element*/
    3450         int analysis_type,approximation,numlayers;
    3451         parameters->FindParam(&analysis_type,AnalysisTypeEnum);
     3449        int approximation,numlayers;
    34523450        if(analysis_type==StressbalanceAnalysisEnum){
    34533451                this->GetInputValue(&approximation,ApproximationEnum);
  • issm/trunk-jpl/src/c/classes/Elements/Element.h

    r25442 r25486  
    164164                void               ResultToMatrix(IssmDouble* values,int ncols,int output_enum);
    165165                void               ResultToVector(Vector<IssmDouble>* vector,int output_enum);
    166                 void               SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum);
     166                void               SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum, int analysis_type);
    167167                void               SetBoolInput(Inputs* inputs,int enum_in,bool value);
    168168
  • issm/trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp

    r25447 r25486  
    3636        numberofdofspernode=femmodel->nodes->MaxNumDofs(GsetEnum);
    3737
    38         /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc 
     38        /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc
    3939         * does, and this routine is essentially useless. Force standard alloc in this case: */
    4040        toolkittype=ToolkitOptions::GetToolkitType();
     
    118118        int numnodesperload     = femmodel->loads->MaxNumNodes();
    119119
     120        int elementssize        = femmodel->elements->Size();
     121        int loadssize           = femmodel->loads->Size();
    120122        /*First, we are building chaining vectors so that we know what nodes are
    121123         * connected to what elements. These vectors are such that:
     
    124126         * id*/
    125127        head_e         = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_e[i]=-1;
    126         next_e         = xNew<int>(femmodel->elements->Size()*numnodesperelement);
    127         count2offset_e = xNew<int>(femmodel->elements->Size()*numnodesperelement);
     128        next_e         = xNew<int>(elementssize*numnodesperelement);
     129        count2offset_e = xNew<int>(elementssize*numnodesperelement);
    128130
    129131        k=0;
    130         for(i=0;i<femmodel->elements->Size();i++){
     132        for(i=0;i<elementssize;i++){
    131133                element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
    132134                int elementnumnodes = element->GetNumberOfNodes();
     
    149151        /*Chain for loads*/
    150152        head_l         = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_l[i]=-1;
    151         next_l         = xNew<int>(femmodel->loads->Size()*numnodesperload);
    152         count2offset_l = xNew<int>(femmodel->loads->Size()*numnodesperload);
     153        next_l         = xNew<int>(loadssize*numnodesperload);
     154        count2offset_l = xNew<int>(loadssize*numnodesperload);
    153155        k=0;
    154         for(i=0;i<femmodel->loads->Size();i++){
     156        for(i=0;i<loadssize;i++){
    155157                load = xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
    156158                int loadnumnodes = load->GetNumberOfNodes();
     
    177179        int  *o_connectivity       = xNewZeroInit<int>(localnumnodes);
    178180        int   flagsindices_counter;
     181        int   analysis_type;
    179182
    180183        Vector<IssmDouble> *connectivity_clone= new Vector<IssmDouble>(localmasters,numnodes);
    181184
     185        femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
    182186        /*Resetting flags to false at each iteration takes a lot of time, so we keep track of the flags
    183187         * to reset in flagsindices, initialized with -1*/
     
    190194                int   lid = node->Lid();
    191195                int   pid = node->Pid();
    192 
    193196                /*Reinitialize flags to false*/
    194197                j=0;
     
    208211                        offset=count2offset_e[j];
    209212                        element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(offset));
    210                         element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,&flagsindices_counter,set1enum,set2enum);
     213                        element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,&flagsindices_counter,set1enum,set2enum,analysis_type);
    211214                        if(node->IsClone()){
    212215                                connectivity_clone->SetValue(pid,d_nz+o_nz,ADD_VAL);
Note: See TracChangeset for help on using the changeset viewer.