/[escript]/branches/trilinos_from_5897/dudley/src/ElementFile.h
ViewVC logotype

Diff of /branches/trilinos_from_5897/dudley/src/ElementFile.h

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

revision 6008 by caltinay, Fri Feb 5 03:37:49 2016 UTC revision 6009 by caltinay, Wed Mar 2 04:13:26 2016 UTC
# Line 14  Line 14 
14  *  *
15  *****************************************************************************/  *****************************************************************************/
16    
17  #ifndef INC_DUDLEY_ELEMENTFILE  #ifndef __DUDLEY_ELEMENTFILE_H__
18  #define INC_DUDLEY_ELEMENTFILE  #define __DUDLEY_ELEMENTFILE_H__
19    
20  #include "Dudley.h"  #include "Dudley.h"
21  #include "NodeFile.h"  #include "NodeFile.h"
22  #include "ElementType.h"  #include "ElementType.h"
 #include "escript/DataC.h"  
23    
24  #ifdef ESYS_MPI  namespace dudley {
 #include "esysUtils/Esys_MPI.h"  
 #endif  
25    
26  typedef struct {  typedef struct {
27      Dudley_Status_t status; /* status of mesh when jacobeans where updated last time */      Dudley_Status_t status;     /* status of mesh when jacobians where updated last time */
28      dim_t numDim;       /* spatial dimension */      dim_t numDim;               /* spatial dimension */
29      dim_t numQuad;      /* number of quadrature nodes used to calculate jacobeans */      dim_t numQuad;              /* number of quadrature nodes used to calculate jacobians */
30      dim_t numShapes;        /* number of shape functions */      dim_t numShapes;            /* number of shape functions */
31      dim_t numElements;      /* number of elements */      dim_t numElements;          /* number of elements */
32      double *absD;       /* used to compute volume */      double *absD;               /* used to compute volume */
33      double quadweight;      /* used to compute volume */      double quadweight;          /* used to compute volume */
34      double *DSDX;       /* derivatives of shape functions in global coordinates at quadrature points */      double *DSDX;               /* derivatives of shape functions in global coordinates at quadrature points */
35  } Dudley_ElementFile_Jacobeans;  } Dudley_ElementFile_Jacobians;
36    
37  struct Dudley_ElementFile {  struct Dudley_ElementFile {
38      esysUtils::JMPI MPIInfo;      escript::JMPI MPIInfo;
39      Esys_MPI_rank *Owner;      int *Owner;
40    
41      dim_t numElements;      /* number of elements. */      dim_t numElements;          /* number of elements. */
42    
43      index_t *Id;        /* Id[i] is the id nmber of      index_t *Id;                /* Id[i] is the id nmber of
44                     node i. this number is not                                     node i. this number is not
45                     used but useful when                                     used but useful when
46                     elements are resorted. in                                     elements are resorted. in
47                     the entire code the term                                     the entire code the term
48                     'element id' refers to i                                     'element id' refers to i
49                     but nor to Id[i] if not                                     but nor to Id[i] if not
50                     explicitly stated                                     explicitly stated
51                     otherwise. */                                     otherwise. */
52    
53      index_t *Tag;       /* Tag[i] is the tag of element i. */      index_t *Tag;               /* Tag[i] is the tag of element i. */
54    
55      index_t *tagsInUse;     /* array of tags which are actually used */      index_t *tagsInUse;         /* array of tags which are actually used */
56      dim_t numTagsInUse;     /* number of tags used */      dim_t numTagsInUse;         /* number of tags used */
57    
58      dim_t numNodes;     /* number of nodes per element */      dim_t numNodes;             /* number of nodes per element */
59      index_t *Nodes;     /* Nodes[INDEX(k, i, numNodes)]      index_t *Nodes;             /* Nodes[INDEX(k, i, numNodes)]
60                     is the k-the node in the                                     is the k-the node in the
61                     i-the element. note that                                     i-the element. note that
62                     in the way the nodes are                                     in the way the nodes are
63                     ordered Nodes[INDEX(k, i, numNodes)                                     ordered Nodes[INDEX(k, i, numNodes)
64                     is k-the node of element i                                     is k-the node of element i
65                     when refering to the                                     when refering to the
66                     linear version of the                                     linear version of the
67                     mesh. */                                     mesh. */
68      index_t minColor;       /* minimum color */      index_t minColor;           /* minimum color */
69      index_t maxColor;       /* maximum color */      index_t maxColor;           /* maximum color */
70      index_t *Color;     /* assigns each element a color. elements with the same color          index_t *Color;             /* assigns each element a color. elements with the same color    
71                     are don't share a node so they can be processed simultaneously                                     are don't share a node so they can be processed simultaneously
72                     at anytime Color must provide a valid value. In any case one can set                                       at anytime Color must provide a valid value. In any case one can set  
73                     Color[e]=e  for all e */                                     Color[e]=e  for all e */
74    
75      Dudley_ElementFile_Jacobeans *jacobeans;    /* jacobeans of the shape function used for solution approximation */      Dudley_ElementFile_Jacobians *jacobians;    /* jacobians of the shape function used for solution approximation */
76      Dudley_ElementFile_Jacobeans *jacobeans_reducedQ;   /* jacobeans of the shape function used for solution approximation for reduced integration order */      Dudley_ElementFile_Jacobians *jacobians_reducedQ;   /* jacobians of the shape function used for solution approximation for reduced integration order */
77      dim_t numDim;       /* spatial dimension of the domain */      dim_t numDim;               /* spatial dimension of the domain */
78      dim_t numLocalDim;      /* dimension of the element eg 2 for A line in 2D or 3D */      dim_t numLocalDim;          /* dimension of the element eg 2 for A line in 2D or 3D */
79      Dudley_ElementTypeId etype; /* element type */      Dudley_ElementTypeId etype; /* element type */
80      const char *ename;      /* name of element type */      const char *ename;          /* name of element type */
81      dim_t numShapes;        /* number of shape functions */      dim_t numShapes;            /* number of shape functions */
82  };  };
83    
84  typedef struct Dudley_ElementFile Dudley_ElementFile;  typedef struct Dudley_ElementFile Dudley_ElementFile;
85  Dudley_ElementFile *Dudley_ElementFile_alloc(Dudley_ElementTypeId etype, esysUtils::JMPI& MPIInfo);  Dudley_ElementFile *Dudley_ElementFile_alloc(Dudley_ElementTypeId etype, escript::JMPI& MPIInfo);
86  void Dudley_ElementFile_free(Dudley_ElementFile *);  void Dudley_ElementFile_free(Dudley_ElementFile *);
87  void Dudley_ElementFile_allocTable(Dudley_ElementFile *, dim_t);  void Dudley_ElementFile_allocTable(Dudley_ElementFile *, dim_t);
88  void Dudley_ElementFile_freeTable(Dudley_ElementFile *);  void Dudley_ElementFile_freeTable(Dudley_ElementFile *);
# Line 93  void Dudley_ElementFile_setElementDistri Line 90  void Dudley_ElementFile_setElementDistri
90  dim_t Dudley_ElementFile_getGlobalNumElements(Dudley_ElementFile * in);  dim_t Dudley_ElementFile_getGlobalNumElements(Dudley_ElementFile * in);
91  dim_t Dudley_ElementFile_getMyNumElements(Dudley_ElementFile * in);  dim_t Dudley_ElementFile_getMyNumElements(Dudley_ElementFile * in);
92  index_t Dudley_ElementFile_getFirstElement(Dudley_ElementFile * in);  index_t Dudley_ElementFile_getFirstElement(Dudley_ElementFile * in);
93  void Dudley_ElementFile_distributeByRankOfDOF(Dudley_ElementFile * self, Esys_MPI_rank * mpiRankOfDOF, index_t * Id);  void Dudley_ElementFile_distributeByRankOfDOF(Dudley_ElementFile * self, int * mpiRankOfDOF, index_t * Id);
94    
95  void Dudley_ElementFile_createColoring(Dudley_ElementFile * in, dim_t numNodes, dim_t * degreeOfFreedom);  void Dudley_ElementFile_createColoring(Dudley_ElementFile * in, dim_t numNodes, dim_t * degreeOfFreedom);
96  void Dudley_ElementFile_optimizeOrdering(Dudley_ElementFile ** in);  void Dudley_ElementFile_optimizeOrdering(Dudley_ElementFile ** in);
# Line 104  void Dudley_ElementFile_scatter(dim_t *, Line 101  void Dudley_ElementFile_scatter(dim_t *,
101  void Dudley_ElementFile_gather(dim_t *, Dudley_ElementFile *, Dudley_ElementFile *);  void Dudley_ElementFile_gather(dim_t *, Dudley_ElementFile *, Dudley_ElementFile *);
102  void Dudley_ElementFile_copyTable(dim_t, Dudley_ElementFile *, dim_t, dim_t, Dudley_ElementFile *);  void Dudley_ElementFile_copyTable(dim_t, Dudley_ElementFile *, dim_t, dim_t, Dudley_ElementFile *);
103  void Dudley_ElementFile_markDOFsConnectedToRange(index_t * mask, index_t offset, index_t marker, index_t firstDOF,  void Dudley_ElementFile_markDOFsConnectedToRange(index_t * mask, index_t offset, index_t marker, index_t firstDOF,
104                           index_t lastDOF, index_t * dofIndex, Dudley_ElementFile * in,                                                   index_t lastDOF, index_t * dofIndex, Dudley_ElementFile * in,
105                           bool useLinear);                                                   bool useLinear);
106    
107  void Dudley_ElementFile_setTags(Dudley_ElementFile *, const int, const escript::Data *);  void Dudley_ElementFile_setTags(Dudley_ElementFile *, const int, const escript::Data *);
108  Dudley_ElementFile_Jacobeans *Dudley_ElementFile_Jacobeans_alloc(void);  Dudley_ElementFile_Jacobians *Dudley_ElementFile_Jacobians_alloc(void);
109  void Dudley_ElementFile_Jacobeans_dealloc(Dudley_ElementFile_Jacobeans *);  void Dudley_ElementFile_Jacobians_dealloc(Dudley_ElementFile_Jacobians *);
110  Dudley_ElementFile_Jacobeans *Dudley_ElementFile_borrowJacobeans(Dudley_ElementFile *, Dudley_NodeFile *, bool);  Dudley_ElementFile_Jacobians *Dudley_ElementFile_borrowJacobians(const Dudley_ElementFile*, const Dudley_NodeFile*, bool);
111  void Dudley_ElementFile_setTagsInUse(Dudley_ElementFile * in);  void Dudley_ElementFile_setTagsInUse(Dudley_ElementFile * in);
112    
113  #endif              /* #ifndef INC_DUDLEY_ELEMENTFILE */  } // namespace dudley
114    
115    #endif // __DUDLEY_ELEMENTFILE_H__
116    

Legend:
Removed from v.6008  
changed lines
  Added in v.6009

  ViewVC Help
Powered by ViewVC 1.1.26