File: GeoData.h

package info (click to toggle)
getdp 2.9.2+dfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 6,384 kB
  • ctags: 8,206
  • sloc: cpp: 55,135; fortran: 13,955; yacc: 8,493; lex: 746; sh: 56; ansic: 34; awk: 33; makefile: 24
file content (134 lines) | stat: -rw-r--r-- 4,748 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
// GetDP - Copyright (C) 1997-2016 P. Dular and C. Geuzaine, University of Liege
//
// See the LICENSE.txt file for license information. Please report all
// bugs and problems to the public mailing list <getdp@onelab.info>.

#ifndef _GEODATA_H_
#define _GEODATA_H_

#include "ListUtils.h"
#include "TreeUtils.h"

struct Grid{
  int     Init;
  List_T  * Bricks;
  double  Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
  int     Nx, Ny, Nz;
};

struct GeoData {
  int     Num ;
  char    * Name ;
  List_T  * Nodes, * Elements ;
  int     NbrElementsWithEdges, NbrElementsWithFacets ;
  int     NumCurrentEdge,  NumCurrentFacet ;
  Tree_T  * EdgesXNodes ,  * FacetsXEdges ;

  Tree_T  * NodesXElements ;
  Tree_T  * Normals ;

  List_T  * GroupForPRE ;

  double  Xmin, Xmax, Ymin, Ymax, Zmin, Zmax ;
  double  Dimension, CharacteristicLength ;

  struct Grid Grid;

  double  * H, * P ;

} ;

int  Geo_AddGeoData(List_T * GeoData_L,
		    char * Name_MshFile, char * Name_DefaultMshFile,
		    char * Name_AdaptFile, char * Name_DefaultAdaptFile) ;
void  Geo_InitGeoData(struct GeoData * GeoData_P, int Num, char * Name) ;
void  Geo_FreeGeoData(struct GeoData * GeoData_P) ;

void  Geo_SetCurrentGeoData(struct GeoData * GeoData_P) ;

void  Geo_OpenFile(char * Name, const char * Mode) ;
void  Geo_CloseFile(void) ;
void  Geo_ReadFile(struct GeoData * GeoData_P) ;
void  Geo_ReadFileAdapt(struct GeoData * GeoData_P) ;

void  Geo_SaveMesh(struct GeoData * GeoData_P, List_T * InitialList, char * FileName) ;

int Geo_GetElementType(int Format, int Type);
int Geo_GetElementTypeInv(int Format, int Type);

int  Geo_GetNbrGeoElements(void) ;
struct Geo_Element  * Geo_GetGeoElement(int Index_Element) ;
int Geo_GetGeoElementIndex(struct Geo_Element * GeoElement) ;
struct Geo_Element  * Geo_GetGeoElementOfNum(int Num_Element) ;

int  Geo_GetNbrGeoNodes(void) ;
struct Geo_Node  * Geo_GetGeoNode(int Index_Node) ;
struct Geo_Node  * Geo_GetGeoNodeOfNum(int Num_Node) ;

void Geo_GetNodesCoordinates(int Nbr_Node, int * Num_Node,
			     double * x, double * y, double * z) ;
void Geo_SetNodesCoordinates(int Nbr_Node, int * Num_Node,
			     double * x, double * y, double * z) ;

void Geo_SetNodesCoordinatesX(int Nbr_Node, int * Num_Node,
			     double * x) ;
void Geo_SetNodesCoordinatesY(int Nbr_Node, int * Num_Node,
			     double * y) ;
void Geo_SetNodesCoordinatesZ(int Nbr_Node, int * Num_Node,
			     double * z) ;

double * Geo_GetNodes_uvw(int Type, int *nbn) ;
double * Geo_GetBarycenter_uvw(int Type) ;

void  Geo_CreateEdgesOfElement(struct Geo_Element * Geo_Element) ;
int  * Geo_GetNodesOfEdgeInElement(struct Geo_Element * Geo_Element, int Num_Edge) ;
void  Geo_CreateFacetsOfElement(struct Geo_Element * Geo_Element) ;
int  * Geo_GetNodesOfFacetInElement(struct Geo_Element * Geo_Element, int Num_Facet) ;

int  * Geo_GetIM_Den(int Type_Element, int * Nbe) ;
int  * Geo_GetIM_Dfe(int Type_Element, int * Nbf) ;
int  * Geo_GetIM_Dfn(int Type_Element, int * Nbf) ;
int  * Geo_GetIM_Den_Xp(int Type_Element, int *Nbe, int *Nbn) ;
int  * Geo_GetIM_Dfe_Xp(int Type_Element, int *Nbf, int *Nbe) ;

void  Geo_CreateEntitiesOfElement
  (int Nbr_Entities2, int * D_Element,
   int   Geo_Element_NbrEntities1, int  * Geo_Element_NumEntities1,
   int * Geo_Element_NbrEntities2, int ** Geo_Element_NumEntities2,
   int * Geo_NbrElementsWithEntities2,
   int * Geo_NumCurrentEntity2, Tree_T * Geo_Entities2XEntities1) ;


void  Geo_GenerateEdgesOfTree(List_T * InitialList, List_T * InitialSuppList,
			      List_T ** ExtendedList) ;
void  Geo_GenerateFacetsOfTree(List_T * InitialList, List_T * InitialSuppList,
			       List_T ** ExtendedList) ;
void  Geo_GenerateEdgesOfSubTree(List_T * InitialList, List_T * ExtendedList,
				 Tree_T * EntitiesInTree_T) ;
void  Geo_GenerateFacetsOfSubTree(List_T * InitialList, List_T * ExtendedList,
				  Tree_T * EntitiesInTree_T) ;
void  Geo_ChangeTreeIndex(void * a, void * b) ;

int  fcmp_GeoData_Name(const void * a, const void * b) ;
int  fcmp_Elm(const void * a, const void * b) ;
int  fcmp_Nod(const void * a, const void * b) ;
int  fcmp_E2XE1(const void * a, const void * b) ;
void free_E2XE1(void * a, void * b) ;
int  fcmp_EXVector(const void * a, const void * b) ;

void  Geo_WriteFilePRE(struct GeoData * GeoData_P, List_T * Group_L) ;
void  Geo_ReadFilePRE(struct GeoData * GeoData_P, int NbrGeoData, List_T * Group_L) ;

void  Geo_WriteEntities2XEntities1(void * a, void * b) ;

void  Geo_AddGroupForPRE(int Num) ;

void  Geo_CreateNodesXElements(int NumNode, int InIndex,
			       int *NbrElements, int **NumElements) ;

void  Geo_CreateNormal(int Type, double *x, double *y, double *z, double *N) ;

void  Geo_CreateNormalOfElement(struct Geo_Element *GeoElement, double *Normal) ;


#endif