[25834] | 1 | Index: ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp
|
---|
| 2 | ===================================================================
|
---|
| 3 | --- ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp (revision 25485)
|
---|
| 4 | +++ ../trunk-jpl/src/c/modules/AllocateSystemMatricesx/AllocateSystemMatricesx.cpp (revision 25486)
|
---|
| 5 | @@ -35,7 +35,7 @@
|
---|
| 6 |
|
---|
| 7 | numberofdofspernode=femmodel->nodes->MaxNumDofs(GsetEnum);
|
---|
| 8 |
|
---|
| 9 | - /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc
|
---|
| 10 | + /*if our matrices are coming from issm, we don't do dynamic allocation like Petsc
|
---|
| 11 | * does, and this routine is essentially useless. Force standard alloc in this case: */
|
---|
| 12 | toolkittype=ToolkitOptions::GetToolkitType();
|
---|
| 13 |
|
---|
| 14 | @@ -117,6 +117,8 @@
|
---|
| 15 | int numnodesperelement = femmodel->elements->MaxNumNodes();
|
---|
| 16 | int numnodesperload = femmodel->loads->MaxNumNodes();
|
---|
| 17 |
|
---|
| 18 | + int elementssize = femmodel->elements->Size();
|
---|
| 19 | + int loadssize = femmodel->loads->Size();
|
---|
| 20 | /*First, we are building chaining vectors so that we know what nodes are
|
---|
| 21 | * connected to what elements. These vectors are such that:
|
---|
| 22 | * for(int i=head[id];i!=-1;i=next[i])
|
---|
| 23 | @@ -123,11 +125,11 @@
|
---|
| 24 | * will loop over all the elements that are connected to the node number
|
---|
| 25 | * id*/
|
---|
| 26 | head_e = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_e[i]=-1;
|
---|
| 27 | - next_e = xNew<int>(femmodel->elements->Size()*numnodesperelement);
|
---|
| 28 | - count2offset_e = xNew<int>(femmodel->elements->Size()*numnodesperelement);
|
---|
| 29 | + next_e = xNew<int>(elementssize*numnodesperelement);
|
---|
| 30 | + count2offset_e = xNew<int>(elementssize*numnodesperelement);
|
---|
| 31 |
|
---|
| 32 | k=0;
|
---|
| 33 | - for(i=0;i<femmodel->elements->Size();i++){
|
---|
| 34 | + for(i=0;i<elementssize;i++){
|
---|
| 35 | element = xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(i));
|
---|
| 36 | int elementnumnodes = element->GetNumberOfNodes();
|
---|
| 37 | lidlist = xNew<int>(elementnumnodes);
|
---|
| 38 | @@ -148,10 +150,10 @@
|
---|
| 39 |
|
---|
| 40 | /*Chain for loads*/
|
---|
| 41 | head_l = xNew<int>(localnumnodes); for(i=0;i<localnumnodes;i++) head_l[i]=-1;
|
---|
| 42 | - next_l = xNew<int>(femmodel->loads->Size()*numnodesperload);
|
---|
| 43 | - count2offset_l = xNew<int>(femmodel->loads->Size()*numnodesperload);
|
---|
| 44 | + next_l = xNew<int>(loadssize*numnodesperload);
|
---|
| 45 | + count2offset_l = xNew<int>(loadssize*numnodesperload);
|
---|
| 46 | k=0;
|
---|
| 47 | - for(i=0;i<femmodel->loads->Size();i++){
|
---|
| 48 | + for(i=0;i<loadssize;i++){
|
---|
| 49 | load = xDynamicCast<Load*>(femmodel->loads->GetObjectByOffset(i));
|
---|
| 50 | int loadnumnodes = load->GetNumberOfNodes();
|
---|
| 51 | lidlist = xNew<int>(loadnumnodes);
|
---|
| 52 | @@ -176,9 +178,11 @@
|
---|
| 53 | int *d_connectivity = xNewZeroInit<int>(localnumnodes);
|
---|
| 54 | int *o_connectivity = xNewZeroInit<int>(localnumnodes);
|
---|
| 55 | int flagsindices_counter;
|
---|
| 56 | + int analysis_type;
|
---|
| 57 |
|
---|
| 58 | Vector<IssmDouble> *connectivity_clone= new Vector<IssmDouble>(localmasters,numnodes);
|
---|
| 59 |
|
---|
| 60 | + femmodel->parameters->FindParam(&analysis_type,AnalysisTypeEnum);
|
---|
| 61 | /*Resetting flags to false at each iteration takes a lot of time, so we keep track of the flags
|
---|
| 62 | * to reset in flagsindices, initialized with -1*/
|
---|
| 63 | for(i = 0;i<localnumnodes;i++) flags[i] = false;
|
---|
| 64 | @@ -189,7 +193,6 @@
|
---|
| 65 | Node* node=xDynamicCast<Node*>(femmodel->nodes->GetObjectByOffset(i));
|
---|
| 66 | int lid = node->Lid();
|
---|
| 67 | int pid = node->Pid();
|
---|
| 68 | -
|
---|
| 69 | /*Reinitialize flags to false*/
|
---|
| 70 | j=0;
|
---|
| 71 | while(j<localnumnodes){
|
---|
| 72 | @@ -207,7 +210,7 @@
|
---|
| 73 | for(j=head_e[lid];j!=-1;j=next_e[j]){
|
---|
| 74 | offset=count2offset_e[j];
|
---|
| 75 | element=xDynamicCast<Element*>(femmodel->elements->GetObjectByOffset(offset));
|
---|
| 76 | - element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,&flagsindices_counter,set1enum,set2enum);
|
---|
| 77 | + element->SetwiseNodeConnectivity(&d_nz,&o_nz,node,flags,flagsindices,&flagsindices_counter,set1enum,set2enum,analysis_type);
|
---|
| 78 | if(node->IsClone()){
|
---|
| 79 | connectivity_clone->SetValue(pid,d_nz+o_nz,ADD_VAL);
|
---|
| 80 | }
|
---|
| 81 | Index: ../trunk-jpl/src/c/classes/Elements/Element.cpp
|
---|
| 82 | ===================================================================
|
---|
| 83 | --- ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 25485)
|
---|
| 84 | +++ ../trunk-jpl/src/c/classes/Elements/Element.cpp (revision 25486)
|
---|
| 85 | @@ -736,6 +736,7 @@
|
---|
| 86 |
|
---|
| 87 | Gauss* gauss=this->NewGauss(5);
|
---|
| 88 | while(gauss->next()){
|
---|
| 89 | +
|
---|
| 90 | this->JacobianDeterminant(&Jdet,xyz_list,gauss);
|
---|
| 91 |
|
---|
| 92 | /*Get strain rate assuming that epsilon has been allocated*/
|
---|
| 93 | @@ -3393,7 +3394,7 @@
|
---|
| 94 |
|
---|
| 95 | }
|
---|
| 96 | /*}}}*/
|
---|
| 97 | -void Element::SetwiseNodeConnectivity(int* pd_nz,int* po_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum){/*{{{*/
|
---|
| 98 | +void 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){/*{{{*/
|
---|
| 99 |
|
---|
| 100 | /*Intermediaries*/
|
---|
| 101 | const int numnodes = this->GetNumberOfNodes();
|
---|
| 102 | @@ -3404,10 +3405,8 @@
|
---|
| 103 |
|
---|
| 104 | /*Loop over all nodes*/
|
---|
| 105 | for(int i=0;i<numnodes;i++){
|
---|
| 106 | -
|
---|
| 107 | int nodelid = this->nodes[i]->Lid();
|
---|
| 108 | if(!flags[nodelid]){
|
---|
| 109 | -
|
---|
| 110 | /*flag current node so that no other element processes it*/
|
---|
| 111 | flags[nodelid]=true;
|
---|
| 112 |
|
---|
| 113 | @@ -3447,8 +3446,7 @@
|
---|
| 114 |
|
---|
| 115 | /*Special case: 2d/3d coupling, the node of this element might be connected
|
---|
| 116 | *to the basal element*/
|
---|
| 117 | - int analysis_type,approximation,numlayers;
|
---|
| 118 | - parameters->FindParam(&analysis_type,AnalysisTypeEnum);
|
---|
| 119 | + int approximation,numlayers;
|
---|
| 120 | if(analysis_type==StressbalanceAnalysisEnum){
|
---|
| 121 | this->GetInputValue(&approximation,ApproximationEnum);
|
---|
| 122 | if(approximation==SSAHOApproximationEnum || approximation==SSAFSApproximationEnum){
|
---|
| 123 | Index: ../trunk-jpl/src/c/classes/Elements/Element.h
|
---|
| 124 | ===================================================================
|
---|
| 125 | --- ../trunk-jpl/src/c/classes/Elements/Element.h (revision 25485)
|
---|
| 126 | +++ ../trunk-jpl/src/c/classes/Elements/Element.h (revision 25486)
|
---|
| 127 | @@ -163,7 +163,7 @@
|
---|
| 128 | void ResultToPatch(IssmDouble* values,int nodesperelement,int output_enum);
|
---|
| 129 | void ResultToMatrix(IssmDouble* values,int ncols,int output_enum);
|
---|
| 130 | void ResultToVector(Vector<IssmDouble>* vector,int output_enum);
|
---|
| 131 | - void SetwiseNodeConnectivity(int* d_nz,int* o_nz,Node* node,bool* flags,int* flagsindices,int* flagsindices_counter,int set1_enum,int set2_enum);
|
---|
| 132 | + 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);
|
---|
| 133 | void SetBoolInput(Inputs* inputs,int enum_in,bool value);
|
---|
| 134 |
|
---|
| 135 | void SetIntInput(Inputs* inputs,int enum_in,int value);
|
---|