/[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 531 by jgs, Fri Jan 27 01:33:02 2006 UTC revision 532 by gross, Wed Feb 15 09:45:53 2006 UTC
# Line 78  void Finley_Assemble_gradient(Finley_Nod Line 78  void Finley_Assemble_gradient(Finley_Nod
78         gradS=elements->LinearReferenceElement->dSdv;         gradS=elements->LinearReferenceElement->dSdv;
79         numNodes=nodes->reducedNumDegreesOfFreedom;         numNodes=nodes->reducedNumDegreesOfFreedom;
80     } else {     } else {
81         Finley_setError(TYPE_ERROR,"__FILE__: Cannot calculate gradient of data");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: Cannot calculate gradient of data");
82    }    }
83    if (getFunctionSpaceType(grad_data)==FINLEY_CONTACT_ELEMENTS_2) {    if (getFunctionSpaceType(grad_data)==FINLEY_CONTACT_ELEMENTS_2) {
84         node_offset=NN-NS;         node_offset=NN-NS;
# Line 91  void Finley_Assemble_gradient(Finley_Nod Line 91  void Finley_Assemble_gradient(Finley_Nod
91    /* check the dimensions of interpolated_data and data */    /* check the dimensions of interpolated_data and data */
92    
93    if (numDim!=elements->ReferenceElement->Type->numDim) {    if (numDim!=elements->ReferenceElement->Type->numDim) {
94       Finley_setError(TYPE_ERROR,"__FILE__: Spatial and element dimension must match.");       Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: Spatial and element dimension must match.");
95    } else if (! numSamplesEqual(grad_data,numQuad,elements->numElements)) {    } else if (! numSamplesEqual(grad_data,numQuad,elements->numElements)) {
96         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples in gradient Data object");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: illegal number of samples in gradient Data object");
97    } else if (! numSamplesEqual(data,1,numNodes)) {    } else if (! numSamplesEqual(data,1,numNodes)) {
98         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of samples of input Data object");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: illegal number of samples of input Data object");
99    } else if (numDim*numComps!=getDataPointSize(grad_data)) {    } else if (numDim*numComps!=getDataPointSize(grad_data)) {
100         Finley_setError(TYPE_ERROR,"__FILE__: illegal number of components in gradient data object.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: illegal number of components in gradient data object.");
101    }  else if (!isExpanded(grad_data)) {    }  else if (!isExpanded(grad_data)) {
102         Finley_setError(TYPE_ERROR,"__FILE__: expanded Data object is expected for output data.");         Finley_setError(TYPE_ERROR,"Finley_Assemble_gradient: expanded Data object is expected for output data.");
103    }    }
104        
105    /* now we can start */    /* now we can start */
# Line 150  void Finley_Assemble_gradient(Finley_Nod Line 150  void Finley_Assemble_gradient(Finley_Nod
150                          }                          }
151                          break;                          break;
152                    }                    }
153                  /*  calculate grad_data(l,i,q)=local_data(l,n)* DSDV(n,i,q) */
154                  // Finley_Util_SmallMatMult(numQuad,numComps,numQuad*numDim,getSampleData(grad_data,e),NS_DOF,local_data,dSdV);
155    
156                /*  calculate d_datadv(l,i,q)=local_data(l,n)*DSDv(n,i,q) */                /*  calculate d_datadv(l,i,q)=local_data(l,n)*DSDv(n,i,q) */
157                Finley_Util_SmallMatMult(numComps,numDim*numQuad,d_datadv,NS_DOF,local_data,gradS);                Finley_Util_SmallMatMult(numComps,numDim*numQuad,d_datadv,NS_DOF,local_data,gradS);
158                /*  calculate grad_data(l,i)=d_datadv(l,i,q)*dvdV(i,k,q) */                /*  calculate grad_data(l,i,q)=d_datadv(l,k,q)*dvdV(k,i,q) */
159                Finley_Util_SmallMatSetMult(numQuad,numComps,numDim,getSampleData(grad_data,e),numDim,d_datadv,dvdV);                Finley_Util_SmallMatSetMult(numQuad,numComps,numDim,getSampleData(grad_data,e),numDim,d_datadv,dvdV);
160              } /* for */              } /* for */
161            }            }

Legend:
Removed from v.531  
changed lines
  Added in v.532

  ViewVC Help
Powered by ViewVC 1.1.26