To get boundary info. from CGNS grid file.
Hi.
I am trying to extract boundary information from structured grid written in CGNS format. I already have dealt with an unstructured grid generated using pointwise, which stores boundary info. in sections unlike other ordinary grid generators(as I know). So I could get boundary info. using "cg_element_read" subroutine from a section. But in this case, I realized that pointwise stores the information in zones not in sections. I tried "1to1"(as "the user's guide" says) subroutine or "boco" subroutine, but they returns ier=1(which means errors occur while using the subroutine). I wanna know what subroutines other people are using to get BC information from structured CGNS file. I am waiting for any reply :) Thanks for reading! Kim |
2 Attachment(s)
First, I strongly suggest you obtain a copy of CGNSView (64-bit). It is free and I think it is part of the CGNS distribution. CGNSView will let you browse the structure of any valid CGNS file!
Pointwise exports structured boundary zones (BCs) as a ZoneBC_t / BC_t sub-node of each structured block node (Zone_t). The CGNS path to each BC patch is: Code:
/Base:CGNSBase_t/BlkName:Zone_t/ZoneBC:ZoneBC_t/ Code:
/Base:CGNSBase_t/BcName:Family_t/ |
I can't find any version for CGNSVIEW . The website says that it has been discontinued. So if you have any link for it would be much appreciated.
|
Quote:
CGNSview is in the cgnstools folder. This is a source-only distribution. You will need to build it yourself. I am not aware of any pre-built, CGNS distributions. Good luck! |
Quote:
I recently working on writing a code to read a CGNS file for my CFD code, but there's a problem which really makes me mad! The problem is that when I export a CGNS grid file form Pointwise, all physical boundary condition has been set to be Familyspecified. I check the CGNS file with CGNSview, and found that the excat boundary condition is store in Familyname in "/Base/Zone 1-split-1/ZoneBC/dom-1-split-1". I kown if I can read this value, I can match it with BC family, and get the physical boundary. However, I have found the CGNS function to read this value for long time but I have not found it yet. Would you please help me out! Thanks |
in cgnslib.h there are a series of functions that deal with family_t nodes:
int cg_nfamilies(int file_number, int B, int *nfamilies); int cg_family_read(int file_number, int B, int F, char *family_name, int *nboco, int *ngeos); int cg_family_write(int file_number, int B, const char * family_name, int *F); int cg_fambc_read(int file_number, int B, int F, int BC, char *fambc_name, CGNS_ENUMT(BCType_t) *bocotype); int cg_fambc_write(int file_number, int B, int F, const char * fambc_name, CGNS_ENUMT(BCType_t) bocotype, int *BC); Pointwise uses the cg_family_write() and cg_fambc_write() functions to export the BC data. For more CGNS details see: CGNS Mid-Level Library CGNS Families SIDS The Pointwise CGNS exporter follows the docs linked above. |
All times are GMT -4. The time now is 01:15. |