/[escript]/trunk/finley/src/Assemble_gradient.c
ViewVC logotype

Diff of /trunk/finley/src/Assemble_gradient.c

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

revision 1061 by gross, Wed Mar 14 00:15:24 2007 UTC revision 1062 by gross, Mon Mar 26 06:17:53 2007 UTC
# Line 43  void Finley_Assemble_gradient(Finley_Nod Line 43  void Finley_Assemble_gradient(Finley_Nod
43    if (nodes==NULL || elements==NULL) return;    if (nodes==NULL || elements==NULL) return;
44    numComps=getDataPointSize(data);    numComps=getDataPointSize(data);
45    NN=elements->ReferenceElement->Type->numNodes;    NN=elements->ReferenceElement->Type->numNodes;
46      reducedIntegrationOrder=Finley_Assemble_reducedIntegrationOrder(grad_data);
47    
48    if (data_type==FINLEY_NODES) {    if (data_type==FINLEY_NODES) {
49         reducedShapefunction=FALSE;         reducedShapefunction=FALSE;
50         numNodes=nodes->numNodes;         numNodes=nodes->numNodes;
51         numShapes=elements->ReferenceElement->Type->numShapes;    } else if (data_type==FINLEY_REDUCED_NODES) { /* TODO */
52         numLocalNodes=elements->ReferenceElement->Type->numNodes;         reducedShapefunction=FALSE;
53           Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: FINLEY_REDUCED_NODES is not supported yet.");
54    }    }
55    /* lock these two options jac for the MPI version */    /* lock these two options jac for the MPI version */
56    #ifndef PASO_MPI    #ifndef PASO_MPI
57    else if (data_type==FINLEY_DEGREES_OF_FREEDOM) {    else if (data_type==FINLEY_DEGREES_OF_FREEDOM) {
58         reducedShapefunction=FALSE;         reducedShapefunction=FALSE;
59         numNodes=nodes->numDegreesOfFreedom;         numNodes=nodes->numDegreesOfFreedom;
        numShapes=elements->ReferenceElement->Type->numShapes;  
        numLocalNodes=elements->ReferenceElement->Type->numNodes;  
60    } else if (data_type==FINLEY_REDUCED_DEGREES_OF_FREEDOM) {    } else if (data_type==FINLEY_REDUCED_DEGREES_OF_FREEDOM) {
61         reducedShapefunction=TRUE;         reducedShapefunction=TRUE;
62         numNodes=nodes->reducedNumDegreesOfFreedom;         numNodes=nodes->reducedNumDegreesOfFreedom;
        numShapes=elements->LinearReferenceElement->Type->numShapes;  
        numLocalNodes=elements->LinearReferenceElement->Type->numNodes;  
63    }    }
64    #endif    #endif
65    else {    else {
66         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: Cannot calculate gradient of data because of unsuitable input data representation.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: Cannot calculate gradient of data because of unsuitable input data representation.");
67    }    }
   if (grad_data_type==FINLEY_ELEMENTS) {  
        reducedIntegrationOrder=FALSE;  
        dof_offset=0;  
   } else if (grad_data_type==FINLEY_FACE_ELEMENTS)  {  
        reducedIntegrationOrder=FALSE;  
        dof_offset=0;  
   } else if (grad_data_type==FINLEY_CONTACT_ELEMENTS_1)  {  
        reducedIntegrationOrder=FALSE;  
        dof_offset=0;  
   } else if (grad_data_type==FINLEY_CONTACT_ELEMENTS_2)  {  
        reducedIntegrationOrder=FALSE;  
        /* don't reset offset */  
   } else {  
        Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: Cannot calculated for requested location.");  
   }  
68    
69    jac=Finley_ElementFile_borrowJacobeans(elements,nodes,reducedShapefunction,reducedIntegrationOrder);    jac=Finley_ElementFile_borrowJacobeans(elements,nodes,reducedShapefunction,reducedIntegrationOrder);
70    if (Finley_noError()) {    if (Finley_noError()) {
71    
72        if (grad_data_type==FINLEY_ELEMENTS) {        if (grad_data_type==FINLEY_CONTACT_ELEMENTS_2 || grad_data_type== FINLEY_REDUCED_CONTACT_ELEMENTS_2)  {
         dof_offset=0;  
         s_offset=0;  
       } else if (grad_data_type==FINLEY_FACE_ELEMENTS)  {  
        dof_offset=0;  
        s_offset=0;  
       } else if (grad_data_type==FINLEY_CONTACT_ELEMENTS_1)  {  
        dof_offset=0;  
        s_offset=0;  
       } else if (grad_data_type==FINLEY_CONTACT_ELEMENTS_2)  {  
73         dof_offset=numShapes;         dof_offset=numShapes;
74         s_offset=jac->ReferenceElement->Type->numShapes;         s_offset=jac->ReferenceElement->Type->numShapes;
75          } else {
76           dof_offset=0;
77           s_offset=0;
78        }        }
79          numShapes=jac->ReferenceElement->Type->numShapes;
80          numLocalNodes=jac->ReferenceElement->Type->numNodes;
81    
82        /* check the dimensions of data */        /* check the dimensions of data */
83    

Legend:
Removed from v.1061  
changed lines
  Added in v.1062

  ViewVC Help
Powered by ViewVC 1.1.26