Skip to content
Snippets Groups Projects
Commit 97c5cd37 authored by Bastien Gorissen's avatar Bastien Gorissen
Browse files

Fixed an issue with internal surface removal.

parent 0e288c68
No related branches found
No related tags found
No related merge requests found
...@@ -565,7 +565,7 @@ int GModel::readCGNS(const std::string &name) ...@@ -565,7 +565,7 @@ int GModel::readCGNS(const std::string &name)
cg_nbases(index_file, &nBases); cg_nbases(index_file, &nBases);
Msg::Debug("Found %i base(s).", nBases); Msg::Debug("Found %i base(s).", nBases);
if (nBases > 1) { if (nBases > 1) {
Msg::Warning("Found %i bases in the file, but only the first one will be generated.", nBases); Msg::Warning("Found %i bases in the file, but only the first one will be used to build mesh.", nBases);
} }
int index_base = 1; int index_base = 1;
...@@ -781,6 +781,9 @@ int GModel::readCGNS(const std::string &name) ...@@ -781,6 +781,9 @@ int GModel::readCGNS(const std::string &name)
cg_n1to1(index_file, index_base, index_zone, &nconnectivity); cg_n1to1(index_file, index_base, index_zone, &nconnectivity);
Msg::Debug("Found %i connectivity zones.", nconnectivity); Msg::Debug("Found %i connectivity zones.", nconnectivity);
for (int index_section = 1; index_section <= nconnectivity; index_section++) { for (int index_section = 1; index_section <= nconnectivity; index_section++) {
printf("ping\n");
char ConnectionName[30]; char ConnectionName[30];
char DonorName[30]; char DonorName[30];
cgsize_t range[6]; cgsize_t range[6];
...@@ -789,13 +792,6 @@ int GModel::readCGNS(const std::string &name) ...@@ -789,13 +792,6 @@ int GModel::readCGNS(const std::string &name)
cg_1to1_read(index_file, index_base, index_zone,index_section, cg_1to1_read(index_file, index_base, index_zone,index_section,
ConnectionName, DonorName, range, donor_range, transform); ConnectionName, DonorName, range, donor_range, transform);
// Do not ignore periodic boundaries when creating elements later on.
float RotationCenter[3];
float RotationAngle[3];
float Translation[3];
if (cg_1to1_periodic_read(index_file, index_base, index_zone, index_section,
RotationCenter, RotationAngle, Translation) != CG_NODE_NOT_FOUND)
continue;
// Checking on which face it is // Checking on which face it is
int face = 0; int face = 0;
...@@ -815,11 +811,28 @@ int GModel::readCGNS(const std::string &name) ...@@ -815,11 +811,28 @@ int GModel::readCGNS(const std::string &name)
else else
face = 1; face = 1;
} }
printf("Face %i\n", face);
int* range_int = new int[6]; int* range_int = new int[6];
for (int r = 0; r < 6; r++)
range_int[r] = (int)range[r];
// Do not ignore periodic boundaries when creating elements later on.
float RotationCenter[3];
float RotationAngle[3];
float Translation[3];
if (cg_1to1_periodic_read(index_file, index_base, index_zone, index_section,
RotationCenter, RotationAngle, Translation) != CG_NODE_NOT_FOUND) {
continue;
}
for (int r = 0; r < 6; r++) {
range_int[r] = (int)range[r];
printf("%i ", range_int[r]);
}
forbidden[face].push_back(range_int); forbidden[face].push_back(range_int);
printf("\npong\n");
} }
...@@ -894,13 +907,15 @@ int GModel::readCGNS(const std::string &name) ...@@ -894,13 +907,15 @@ int GModel::readCGNS(const std::string &name)
for (int ff=0; ff < forbidden[face].size(); ff++) { for (int ff=0; ff < forbidden[face].size(); ff++) {
int* lim = forbidden[face][ff]; int* lim = forbidden[face][ff];
if ((i >= fmin(lim[0], lim[3])-1 && i <= fmax(lim[0], lim[3])) || (igrow == 0 && i == lim[0]-1) ) { if ((i >= fmin(lim[0], lim[3])-1 && i < fmax(lim[0], lim[3])-1) || (igrow == 0) ) {
if ((j >= fmin(lim[1], lim[4])-1 && j <= fmax(lim[1],lim[4])) || (jgrow == 0 && j == lim[1]-1) ) { if ((j >= fmin(lim[1], lim[4])-1 && j < fmax(lim[1],lim[4])-1) || (jgrow == 0) ) {
if ((k >= fmin(lim[2], lim[5])-1 && k <= fmax(lim[2], lim[5])) || (kgrow == 0 && k == lim[2]-1) ) { if ((k >= fmin(lim[2], lim[5])-1 && k < fmax(lim[2], lim[5])-1) || (kgrow == 0) ) {
ok = false; ok = false;
} }
} }
} }
//if (!ok) continue;
} }
if (!ok) continue; if (!ok) continue;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment