/[escript]/branches/doubleplusgood/dudley/src/Mesh.cpp
ViewVC logotype

Diff of /branches/doubleplusgood/dudley/src/Mesh.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2748 by gross, Tue Nov 17 07:32:59 2009 UTC revision 2856 by gross, Mon Jan 18 04:14:37 2010 UTC
# Line 24  Line 24 
24  /*   allocates a Mesh with name name for elements of type id using an integration order. If order is negative, */  /*   allocates a Mesh with name name for elements of type id using an integration order. If order is negative, */
25  /*   the most appropriate order is selected indepently. */  /*   the most appropriate order is selected indepently. */
26    
27  Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, index_t order, index_t reduced_order, Paso_MPIInfo *mpi_info)  Finley_Mesh* Finley_Mesh_alloc(char* name,dim_t numDim, Paso_MPIInfo *mpi_info)
28  {  {
29    Finley_Mesh *out;    Finley_Mesh *out;
30        
# Line 65  Finley_Mesh* Finley_Mesh_alloc(char* nam Line 65  Finley_Mesh* Finley_Mesh_alloc(char* nam
65        Finley_Mesh_free(out);        Finley_Mesh_free(out);
66        return NULL;        return NULL;
67    }    }
68    out->order=order;    out->approximationOrder=-1;
69    out->reduced_order=reduced_order;    out->reducedApproximationOrder=-1;
70      out->integrationOrder=-1;
71      out->reducedIntegrationOrder=-1;
72    
73    out->Elements=NULL;    out->Elements=NULL;
74    out->FaceElements=NULL;    out->FaceElements=NULL;
75    out->Points=NULL;    out->Points=NULL;
# Line 138  int  Finley_Mesh_getStatus(Finley_Mesh* Line 141  int  Finley_Mesh_getStatus(Finley_Mesh*
141          return in->Nodes->status;          return in->Nodes->status;
142     }     }
143  }  }
144    
145    void Mesh_setOrders(Finley_Mesh *in)
146    {
147       const dim_t order_max=9999999;
148       dim_t locals[4];
149       #ifdef PASO_MPI
150           dim_t globals[4];
151       #endif
152       locals[0]=order_max; locals[1]=order_max; locals[2]=order_max; locals[3]=order_max;
153    
154      if ( in->Elements!=NULL) {
155         if (in->Elements->numElements > 0) {
156             locals[0]=MIN(locals[0], in->Elements->referenceElementSet->referenceElement->BasisFunctions->Type->numOrder);
157             locals[1]=MIN(locals[1], in->Elements->referenceElementSet->referenceElement->LinearBasisFunctions->Type->numOrder);
158             locals[2]=MIN(locals[2], in->Elements->referenceElementSet->referenceElement->integrationOrder);
159             locals[3]=MIN(locals[3], in->Elements->referenceElementSet->referenceElementReducedQuadrature->integrationOrder);
160         }
161      }
162      if ( in->FaceElements!=NULL) {
163         if (in->FaceElements->numElements > 0) {
164             locals[0]=MIN(locals[0], in->FaceElements->referenceElementSet->referenceElement->BasisFunctions->Type->numOrder);
165             locals[1]=MIN(locals[1], in->FaceElements->referenceElementSet->referenceElement->LinearBasisFunctions->Type->numOrder);
166             locals[2]=MIN(locals[2], in->FaceElements->referenceElementSet->referenceElement->integrationOrder);
167             locals[3]=MIN(locals[3], in->FaceElements->referenceElementSet->referenceElementReducedQuadrature->integrationOrder);
168         }
169    
170    
171      }
172      if ( in->ContactElements!=NULL) {
173         if (in->ContactElements->numElements > 0) {
174             locals[0]=MIN(locals[0], in->ContactElements->referenceElementSet->referenceElement->BasisFunctions->Type->numOrder);
175             locals[1]=MIN(locals[1], in->ContactElements->referenceElementSet->referenceElement->LinearBasisFunctions->Type->numOrder);
176             locals[2]=MIN(locals[2], in->ContactElements->referenceElementSet->referenceElement->integrationOrder);
177             locals[3]=MIN(locals[3], in->ContactElements->referenceElementSet->referenceElementReducedQuadrature->integrationOrder);
178         }
179    
180      }
181    
182       #ifdef PASO_MPI
183           MPI_Allreduce( locals, globals, 4, MPI_INT, MPI_MIN, in->MPIInfo->comm );
184           in->approximationOrder=(globals[0] < order_max ? globals[0] : -1 );
185           in->reducedApproximationOrder=(globals[1] < order_max ? globals[1] : -1 );
186           in->integrationOrder=(globals[2] < order_max ? globals[2] : -1 );
187           in->reducedIntegrationOrder=(globals[3] < order_max ? globals[3] : -1 );
188       #else
189           in->approximationOrder=(locals[0] < order_max ? locals[0] : -1 );
190           in->reducedApproximationOrder=(locals[1] < order_max ? locals[1] : -1 );
191           in->integrationOrder=(locals[2] < order_max ? locals[2] : -1 );
192           in->reducedIntegrationOrder=(locals[3] < order_max ? locals[3] : -1 );
193       #endif
194    
195    
196    }
197      

Legend:
Removed from v.2748  
changed lines
  Added in v.2856

  ViewVC Help
Powered by ViewVC 1.1.26