"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cgnstools/utilities/cgns_to_aflr3.c" between
CGNS-4.1.2.tar.gz and CGNS-4.2.0.tar.gz

About: The CGNS (CFD General Notation System) provides a standard for recording and recovering computer data associated with the numerical solution of fluid dynamics equations.

cgns_to_aflr3.c  (CGNS-4.1.2):cgns_to_aflr3.c  (CGNS-4.2.0)
skipping to change at line 18 skipping to change at line 18
#define ACCESS _access #define ACCESS _access
#else #else
#include <unistd.h> #include <unistd.h>
#define ACCESS access #define ACCESS access
#endif #endif
#include "cgnslib.h" #include "cgnslib.h"
#include "getargs.h" #include "getargs.h"
#include "hash.h" #include "hash.h"
#include "cgns_header.h"
extern cgns_posit* posit;
#ifndef CGNS_ENUMV #ifndef CGNS_ENUMV
# define CGNS_ENUMV(V) V # define CGNS_ENUMV(V) V
# define CGNS_ENUMT(T) T # define CGNS_ENUMT(T) T
#endif #endif
#if defined(_WIN32) || defined(__CYGWIN__) || defined(__linux) || \ #if defined(_WIN32) || defined(__CYGWIN__) || defined(__linux) || \
defined(__alpha) || defined(__ultrix) defined(__alpha) || defined(__ultrix)
# ifndef LITTLE_ENDIAN # ifndef LITTLE_ENDIAN
# define LITTLE_ENDIAN # define LITTLE_ENDIAN
# endif # endif
skipping to change at line 81 skipping to change at line 84
int nnodes; int nnodes;
cgsize_t nodes[4]; cgsize_t nodes[4];
} FACE; } FACE;
static int nFaces; static int nFaces;
static FACE **Faces; static FACE **Faces;
typedef struct { typedef struct {
CGNS_ENUMT(BCType_t) type; CGNS_ENUMT(BCType_t) type;
char name[33]; char name[33];
char family[CG_MAX_GOTO_DEPTH * 33 + 1];
} BOCO; } BOCO;
static int nBocos = 0; static int nBocos = 0;
static BOCO *Bocos; static BOCO *Bocos;
static int facenodes[20][5] = { static int facenodes[20][5] = {
/* tet */ /* tet */
{3, 0, 2, 1, 0}, {3, 0, 2, 1, 0},
{3, 0, 1, 3, 0}, {3, 0, 1, 3, 0},
{3, 1, 2, 3, 0}, {3, 1, 2, 3, 0},
skipping to change at line 929 skipping to change at line 933
if (nBocos) { if (nBocos) {
Bocos = (BOCO *)malloc(nBocos * sizeof(BOCO)); Bocos = (BOCO *)malloc(nBocos * sizeof(BOCO));
if (Bocos == NULL) err_exit(NULL, "malloc failed for bocos"); if (Bocos == NULL) err_exit(NULL, "malloc failed for bocos");
for (nb = 1; nb <= nBocos; nb++) { for (nb = 1; nb <= nBocos; nb++) {
if (cg_boco_info(cgFile, cgBase, cgZone, nb, name, if (cg_boco_info(cgFile, cgBase, cgZone, nb, name,
&bctype, &ptype, &np, nrmlindex, &is, &bctype, &ptype, &np, nrmlindex, &is,
&datatype, &ib)) &datatype, &ib))
err_exit("cg_boco_info", NULL); err_exit("cg_boco_info", NULL);
Bocos[nb-1].type = bctype; Bocos[nb-1].type = bctype;
Bocos[nb - 1].family[0] = '\0';
strcpy(Bocos[nb-1].name, name); strcpy(Bocos[nb-1].name, name);
if (cg_boco_gridlocation_read(cgFile, cgBase, cgZone, if (cg_boco_gridlocation_read(cgFile, cgBase, cgZone,
nb, &location)) nb, &location))
err_exit("cg_boco_gridlocation_read", NULL); err_exit("cg_boco_gridlocation_read", NULL);
ptset = (cgsize_t *)malloc((size_t)(np * dim) * sizeof(cgsize_t)); ptset = (cgsize_t *)malloc((size_t)(np * dim) * sizeof(cgsize_t));
if (ptset == NULL) if (ptset == NULL)
err_exit(NULL, "malloc failed for boco ptset"); err_exit(NULL, "malloc failed for boco ptset");
if (cg_boco_read(cgFile, cgBase, cgZone, nb, ptset, 0)) if (cg_boco_read(cgFile, cgBase, cgZone, nb, ptset, 0))
err_exit("cg_boco_read", NULL); err_exit("cg_boco_read", NULL);
if (bctype == CGNS_ENUMV(FamilySpecified)) {
cg_goto(cgFile, cgBase, "Zone_t", cgZone, "ZoneBC_t", 1 , "BC_t"
, nb, NULL);
cg_famname_read(Bocos[nb - 1].family);
}
if (is_structured) if (is_structured)
structured_boundary(nb, ptype, location, np, ptset); structured_boundary(nb, ptype, location, np, ptset);
else else
unstructured_boundary(nb, ptype, location, np, ptset); unstructured_boundary(nb, ptype, location, np, ptset);
free(ptset); free(ptset);
} }
/* correction for FamilySpecified */
for (nb = 0; nb < nBocos; nb++) {
if (Bocos[nb].type != CGNS_ENUMV(FamilySpecified)) {
continue;
}
if (strlen(Bocos[nb].family) > 0 && Bocos[nb].family[0] == '/') {
if (cg_gopath(cgFile, Bocos[nb].family) != CG_OK) {
continue;
}
}
else {
if (cg_goto(cgFile, cgBase, Bocos[nb].family, 0, NULL) != CG_OK)
{
continue;
}
}
if (cg_gorel(cgFile, "FamilyBC_t", 1, NULL) != CG_OK) {
continue;
}
cgns_fambc* f = (cgns_fambc*)posit->posit;
Bocos[nb].type = f->type;
}
} }
for (np = 0; np < nFaces; np++) { for (np = 0; np < nFaces; np++) {
if (Faces[np]->bcnum < 0) if (Faces[np]->bcnum < 0)
Faces[np]->bcnum = nBocos - Faces[np]->bcnum; Faces[np]->bcnum = nBocos - Faces[np]->bcnum;
} }
} }
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
 End of changes. 5 change blocks. 
1 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)