/[escript]/branches/domexper/dudley/src/ElementFile_jacobeans.c
ViewVC logotype

Diff of /branches/domexper/dudley/src/ElementFile_jacobeans.c

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

revision 3220 by jfenwick, Wed Sep 29 00:33:16 2010 UTC revision 3221 by jfenwick, Wed Sep 29 01:00:21 2010 UTC
# Line 29  Dudley_ElementFile_Jacobeans* Dudley_Ele Line 29  Dudley_ElementFile_Jacobeans* Dudley_Ele
29       return NULL;       return NULL;
30    } else {    } else {
31       out->status=DUDLEY_INITIAL_STATUS-1;       out->status=DUDLEY_INITIAL_STATUS-1;
 //     out->BasisFunctions=Dudley_ShapeFunction_reference(BasisFunctions);  
32       out->numDim=0;       out->numDim=0;
33       out->numQuad=0;       out->numQuad=0;
34       out->numElements=0;       out->numElements=0;
# Line 45  Dudley_ElementFile_Jacobeans* Dudley_Ele Line 44  Dudley_ElementFile_Jacobeans* Dudley_Ele
44  void Dudley_ElementFile_Jacobeans_dealloc(Dudley_ElementFile_Jacobeans* in)  void Dudley_ElementFile_Jacobeans_dealloc(Dudley_ElementFile_Jacobeans* in)
45  {  {
46    if (in!=NULL) {    if (in!=NULL) {
 //  Dudley_ShapeFunction_dealloc(in->BasisFunctions);    
47      MEMFREE(in->DSDX);      MEMFREE(in->DSDX);
48      MEMFREE(in->absD);      MEMFREE(in->absD);
49      MEMFREE(in);      MEMFREE(in);
# Line 58  void Dudley_ElementFile_Jacobeans_deallo Line 56  void Dudley_ElementFile_Jacobeans_deallo
56  Dudley_ElementFile_Jacobeans* Dudley_ElementFile_borrowJacobeans(Dudley_ElementFile* self, Dudley_NodeFile* nodes,  Dudley_ElementFile_Jacobeans* Dudley_ElementFile_borrowJacobeans(Dudley_ElementFile* self, Dudley_NodeFile* nodes,
57                                                                   bool_t reducedIntegrationOrder) {                                                                   bool_t reducedIntegrationOrder) {
58    Dudley_ElementFile_Jacobeans *out = NULL;    Dudley_ElementFile_Jacobeans *out = NULL;
 //  Dudley_ShapeFunction /* *shape=NULL, */ *basis;  
 //  Dudley_ReferenceElement*  refElement=NULL;  
 //  double *dBdv;  
59        
60    dim_t numNodes=self->numNodes;    dim_t numNodes=self->numNodes;
61        
# Line 74  Dudley_ElementFile_Jacobeans* Dudley_Ele Line 69  Dudley_ElementFile_Jacobeans* Dudley_Ele
69    }    }
70    if (out->status < nodes->status)    if (out->status < nodes->status)
71    {    {
 //     basis=out->BasisFunctions;  
 //     refElement= Dudley_ReferenceElementSet_borrowReferenceElement(self->referenceElementSet, reducedIntegrationOrder);  
   
72       out->numDim=nodes->numDim;       out->numDim=nodes->numDim;
73       out->numQuad=QuadNums[self->numDim][!reducedIntegrationOrder];       out->numQuad=QuadNums[self->numDim][!reducedIntegrationOrder];
 //     out->numShapes=basis->Type->numShapes;  
74       out->numShapes=self->numDim+1;       out->numShapes=self->numDim+1;
75       out->numElements=self->numElements;       out->numElements=self->numElements;
       
 //      if (reducedShapefunction) {  
 //         dBdv=basis->dSdv;  
 //      } else {  
 //        dBdv=refElement->DBasisFunctionDv;  
 //      }  
       
 //      if (out->numQuad != basis->numQuadNodes) {  
 //         Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: Incorrect total number of quadrature points.");  
 //         return NULL;  
 //      }  
 //      if (refElement->numNodes> numNodes) {  
 //            Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: Too many nodes expected.");  
 //            return NULL;  
 //      }  
   
76       if (out->DSDX==NULL) out->DSDX=MEMALLOC((out->numElements)       if (out->DSDX==NULL) out->DSDX=MEMALLOC((out->numElements)
77                                              *(out->numShapes)                                              *(out->numShapes)
78                                              *(out->numDim)                                              *(out->numDim)
# Line 112  Dudley_ElementFile_Jacobeans* Dudley_Ele Line 87  Dudley_ElementFile_Jacobeans* Dudley_Ele
87               if (self->numLocalDim==0) {               if (self->numLocalDim==0) {
88                   Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: 2D does not support local dimension 0.");                   Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: 2D does not support local dimension 0.");
89               } else if (self->numLocalDim==1) {               } else if (self->numLocalDim==1) {
 //        if (out->BasisFunctions->Type->numDim==1) {  
   
90                          Assemble_jacobeans_2D_M1D_E1D(nodes->Coordinates, out->numQuad, self->numElements, numNodes,self->Nodes, out->DSDX,out->absD, &(out->quadweight), self->Id);                          Assemble_jacobeans_2D_M1D_E1D(nodes->Coordinates, out->numQuad, self->numElements, numNodes,self->Nodes, out->DSDX,out->absD, &(out->quadweight), self->Id);
 //                  } else {  
 //                    Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: element dimension for local dimenion 1 in a 2D domain has to be 1.");  
 //                  }  
91               } else if (self->numLocalDim==2) {               } else if (self->numLocalDim==2) {
92                       Assemble_jacobeans_2D(nodes->Coordinates,out->numQuad, self->numElements,numNodes,self->Nodes,                       Assemble_jacobeans_2D(nodes->Coordinates,out->numQuad, self->numElements,numNodes,self->Nodes,
93                                             out->DSDX, out->absD, &(out->quadweight), self->Id);                                             out->DSDX, out->absD, &(out->quadweight), self->Id);
# Line 129  Dudley_ElementFile_Jacobeans* Dudley_Ele Line 99  Dudley_ElementFile_Jacobeans* Dudley_Ele
99               if (self->numLocalDim==0) {               if (self->numLocalDim==0) {
100            Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: 3D does not support local dimension 0.");            Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: 3D does not support local dimension 0.");
101               } else if (self->numLocalDim==2) {               } else if (self->numLocalDim==2) {
 //        if (out->BasisFunctions->Type->numDim==2) {  
102                          Assemble_jacobeans_3D_M2D_E2D(nodes->Coordinates,out->numQuad,self->numElements,numNodes,self->Nodes,                          Assemble_jacobeans_3D_M2D_E2D(nodes->Coordinates,out->numQuad,self->numElements,numNodes,self->Nodes,
103                                                        out->DSDX,out->absD, &(out->quadweight), self->Id);                                                        out->DSDX,out->absD, &(out->quadweight), self->Id);
 //                  } else {  
 //                    Dudley_setError(SYSTEM_ERROR,"Dudley_ElementFile_borrowJacobeans: element dimension for local dimenion 2 in a 3D domain has to be 2.");  
 //                  }  
104               } else if (self->numLocalDim==3) {               } else if (self->numLocalDim==3) {
105                       Assemble_jacobeans_3D(nodes->Coordinates,out->numQuad,self->numElements,numNodes,self->Nodes,                       Assemble_jacobeans_3D(nodes->Coordinates,out->numQuad,self->numElements,numNodes,self->Nodes,
106                                             out->DSDX,out->absD, &(out->quadweight), self->Id);                                             out->DSDX,out->absD, &(out->quadweight), self->Id);

Legend:
Removed from v.3220  
changed lines
  Added in v.3221

  ViewVC Help
Powered by ViewVC 1.1.26