Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare and write CGNS boundary connectivity and ZoneBC in one base #395

Open
wants to merge 72 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
72 commits
Select commit Hold shift click to select a range
8436909
Merging develop into master
Mar 10, 2023
97523f8
Merging develop into master
Jul 1, 2023
86016ed
starting with a merge of work done to bring CGNS to compile with C 11
KennethEJansen Jul 31, 2023
7aa1eb9
baby step of copying phGeomBC.cc to phCGNSgbc.cc and makeing the mods…
KennethEJansen Aug 5, 2023
07e45c4
compiles with code to generate PETSc-style-global-node-number =ncorp[…
KennethEJansen Aug 5, 2023
b9e0822
possibly correct (compiles a least) of connectivity data to global nu…
KennethEJansen Aug 5, 2023
81a707b
Cleaned up a few bugs, added useful numbers to the o data structure f…
KennethEJansen Aug 5, 2023
b920292
Added input flag (writeCGNSFiles 1 in adapt.inp) to call writeCGNS th…
KennethEJansen Aug 6, 2023
885d577
opened CGNS file and computed global counts it needs
KennethEJansen Aug 6, 2023
aa48cae
writing coordinates compiles
KennethEJansen Aug 6, 2023
ec7e650
in pretty far over my C skill level at this point....cgns libary s…
KennethEJansen Aug 6, 2023
3a934bb
compiling version that, if I made no errors, will write a CGNS coordi…
KennethEJansen Aug 6, 2023
dac4caa
runs through chef and produces a chefOut.cgns but it crashes paraview…
KennethEJansen Aug 7, 2023
742b226
first big bug squashed but there are more
KennethEJansen Aug 7, 2023
3959fad
fixed the usual -1 c and fortran bug
KennethEJansen Aug 7, 2023
32fcbaa
fprintf confirms data for coordinates and connectivity look correct
KennethEJansen Aug 7, 2023
21b183f
every cgpxx call is wrapped with cgp_error_exit() which I assume mean…
KennethEJansen Aug 7, 2023
b527512
added switch/case statment to handle tets. I have not cross checked…
KennethEJansen Aug 7, 2023
ebf92d8
seems like boundary elements are running through except the mixed wed…
KennethEJansen Aug 8, 2023
d502292
srfID extracted and currently being printed to the screen. Output lo…
KennethEJansen Aug 8, 2023
93919ec
fix: String constant must be char[], not char*
jrwrigh Aug 8, 2023
c49e7a5
style: Misc formatting, trailing spaces
jrwrigh Aug 8, 2023
e54436f
messy debug code that I save to potentially help debug later but next…
KennethEJansen Aug 10, 2023
5457288
cleaned up but failing AllHex 128 element case.
KennethEJansen Aug 10, 2023
d724b54
AllHex working for 2 and 4 processes
KennethEJansen Aug 10, 2023
6e2c075
spurious paste of a free command from who knows where
KennethEJansen Aug 10, 2023
08cf076
now writing the rank of writer as a cell centered value as a test field
KennethEJansen Aug 10, 2023
ed65be9
chef: Write ZoneBC/GridLocations for serial box meshes
jrwrigh Aug 10, 2023
8d066a5
partition of writer helper arrays added to userData. Also added srfI…
KennethEJansen Aug 11, 2023
332982d
merged with JRW work
KennethEJansen Aug 11, 2023
51ee9ea
fix: Correct boco index offset
jrwrigh Aug 11, 2023
0d39b03
style: Fix indent of for loop, remove commented code
jrwrigh Aug 11, 2023
0ed9a51
small cleanup
KennethEJansen Aug 11, 2023
fdefc14
srfID moved out of boundary element topology loop and dimensioned to …
KennethEJansen Aug 11, 2023
ff16778
not so ugly printf statements restored to find issue with tri-face bels.
KennethEJansen Aug 11, 2023
83bc5bc
cut and paste error was the tri-face problem...fixed
KennethEJansen Aug 11, 2023
1fdd6ed
Wedges working. Tets now positive volume. All boundary element have…
KennethEJansen Aug 11, 2023
cccf8b3
mixed wedge and tet volume elemement meshes pass a sniff test of cgns…
KennethEJansen Aug 11, 2023
a6fc037
fixed bug in srfID write for parallel with multiple topologies
KennethEJansen Aug 12, 2023
f68aa5f
parallel BC write almost working
KennethEJansen Aug 12, 2023
0b09db1
gather is not good enough for cg_boco_write but committing the failur…
KennethEJansen Aug 12, 2023
aaa56c5
Gather->Allgather produces correct result....but what other insane pe…
KennethEJansen Aug 12, 2023
2fd47b1
replaced the STL sort which the web says is Nlog_2N in distance betwe…
KennethEJansen Aug 13, 2023
5ef895d
As I test on a bump mesh I realize the help message is a bit out of d…
KennethEJansen Aug 14, 2023
b448217
Initial condition extracted and written to CGNS. For now, PHASTA rest…
KennethEJansen Aug 14, 2023
7cb7309
committing an aborted attempt to find matching faces through matched …
KennethEJansen Aug 16, 2023
cf50e79
SurfID1 and SurfID2 are in the same order to support periodicity of t…
KennethEJansen Aug 17, 2023
1375cc1
CGNS standard for defining periodic interface compplete and tested fo…
KennethEJansen Aug 17, 2023
ae008bd
valgrind now only shows HDF5-MPIO issues
KennethEJansen Aug 18, 2023
449e8e2
split writeBlocksCGNS into three for readability
KennethEJansen Aug 18, 2023
0bf5313
more helper functions to improve readability
KennethEJansen Aug 18, 2023
cb1131a
helper functions broke up remaining code such that all functions fit …
KennethEJansen Aug 19, 2023
9d7f038
Computing translation vector by difference of cenroids of first, orde…
KennethEJansen Aug 19, 2023
449025c
Centroid sort now only done on rank 0 and results bcast back toother…
KennethEJansen Aug 19, 2023
1c8507d
incomplete fix of matchedNodeElmReader...forgot to change the expecte…
KennethEJansen Aug 22, 2023
61d2cbb
hacky way of handling multiple toplogy wrote connectivity without han…
KennethEJansen Aug 22, 2023
f348df8
multi-topology hopefully handled properly now. Passes small tests bu…
KennethEJansen Aug 23, 2023
35426c6
Adding a text file to describe developments, current assumptions/limi…
KennethEJansen Aug 25, 2023
2931f6b
Enums neededed to be compatable with non-Spack builds
KennethEJansen Aug 27, 2023
0d96a63
srfID for BEL only and thus index must be offset by eVolElm
KennethEJansen Aug 27, 2023
f40b140
Merge branch 'CGNS_OneBase' of github.com:SCOREC/core into CGNS_OneBase
KennethEJansen Aug 27, 2023
93d9032
all debugging out encased in 0==1 conditional
KennethEJansen Aug 27, 2023
37d2853
valgrind found some slopiness
KennethEJansen Aug 27, 2023
e530971
added 13 tests
KennethEJansen Aug 28, 2023
71bf7b4
removed some dead code
KennethEJansen Aug 28, 2023
dc05773
fixed matchedNodeElmReader tests to eliminate unused argument 9
KennethEJansen Aug 29, 2023
364895c
fixed swapDoubles-- needed a call to MPI_Finalize to pass with openMPI 4
KennethEJansen Aug 29, 2023
20b9a7d
Testing disables prior CGNS tests that are hardwired to 32 bit
KennethEJansen Sep 1, 2023
dd2b713
Valgrind leaks, added VertexRank, replaced RankOfWriter with CellRank…
KennethEJansen Sep 3, 2023
bdc26b5
checking this in with some extra commented code on my failure to get …
KennethEJansen Sep 3, 2023
d242875
cleaned dead/commented code, valgrind check again, created more helpd…
KennethEJansen Sep 3, 2023
e65dd2c
_rebase was a trainwreck getting things from there back onto this br…
KennethEJansen Jun 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Added input flag (writeCGNSFiles 1 in adapt.inp) to call writeCGNS th…
…ough it does not yet actually write a CGNS file in the function writeCNGS
  • Loading branch information
KennethEJansen committed Aug 6, 2023
commit b920292e20d7b0c3c3648ba7635c12a0bc97581b
29 changes: 11 additions & 18 deletions phasta/phCGNSgbc.cc
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 180,7 @@ static lcorp_t count_owned(int* ilwork, int nlwork,gcorp_t* ncorp_tmp, int num_n


// renamed, retained but not yet updated
static std::string buildCGNSgbcFileName(std::string timestep_or_dat)
static std::string buildCGNSFileName(std::string timestep_or_dat)
{
std::stringstream ss;
int rank = PCU_Comm_Self() 1;
Expand Down Expand Up @@ -283,13 283,12 @@ void writeBlocksCGNS(FILE* f, Output& o)



// retaining in case it is useful but only renamed at this point
void writeCGNSgbc(Output& o, std::string path, int timestep)
// WIP
void writeCGNS(Output& o, std::string path)
{
double t0 = PCU_Time();
apf::Mesh* m = o.mesh;
std::stringstream tss;
std::string timestep_or_dat;
// copied gen_ncorp from PHASTA to help map on-rank numbering to CGNS/PETSC friendly global numbering
gen_ncorp( o );
// o carries
Expand All @@ -313,20 312,14 @@ void writeCGNSgbc(Output& o, std::string path, int timestep)
}


if (! timestep)
timestep_or_dat = "dat";
else {
tss << timestep;
timestep_or_dat = tss.str();
}
path = buildCGNSgbcFileName(timestep_or_dat);
phastaio_setfile(GEOMBC_WRITE);
FILE* f = o.openfile_write(o, path.c_str());
if (!f) {
lion_eprint(1,"failed to open \"%s\"!\n", path.c_str());
abort();
}
ph_write_preamble(f);
// path = buildCGNSFileName(timestep_or_dat);
// phastaio_setfile(GEOMBC_WRITE);
// FILE* f = o.openfile_write(o, path.c_str());
// if (!f) {
// lion_eprint(1,"failed to open \"%s\"!\n", path.c_str());
// abort();
// }
// ph_write_preamble(f);
int params[MAX_PARAMS];

/* all of these strings are looked for by the other programs
Expand Down
2 changes: 2 additions & 0 deletions phasta/phCook.cc
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 224,8 @@ namespace ph {
out.openfile_write = fn;
}
ph::writeGeomBC(out, subDirPath); //write geombc
if ( in.writeCGNSFiles )
ph::writeCGNS(out, subDirPath); //write CGNS
if(!PCU_Comm_Self())
ph::writeAuxiliaryFiles(path, in.timeStepNumber);
m->verify();
Expand Down
2 changes: 2 additions & 0 deletions phasta/phInput.cc
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 60,7 @@ static void setDefaults(Input& in)
in.axisymmetry = 0;
in.parmaLoops = 3; //a magical value
in.parmaVerbosity = 1; //fairly quiet
in.writeCGNSFiles = 0; // write CGNS Files
in.writeGeomBCFiles = 0; // write additional geombc file for vis in streaming
in.writeRestartFiles = 0; // write additional restart file for vis in streaming
in.writeVTK = 0;
Expand Down Expand Up @@ -153,6 154,7 @@ static void formMaps(Input& in, StringMap& stringMap, IntMap& intMap, DblMap& db
intMap["parmaLoops"] = &in.parmaLoops;
intMap["parmaVerbosity"] = &in.parmaVerbosity;
intMap["writeVTK"] = &in.writeVTK;
intMap["writeCGNSFiles"] = &in.writeCGNSFiles;
intMap["writeGeomBCFiles"] = &in.writeGeomBCFiles;
intMap["writeRestartFiles"] = &in.writeRestartFiles;
intMap["ramdisk"] = &in.ramdisk;
Expand Down
2 changes: 2 additions & 0 deletions phasta/phInput.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 147,8 @@ class Input
/** \brief write the geombc file during in-memory data transfer
between phasta and chef. */
int writeGeomBCFiles;
/* \brief write CGNS files for pre-processing */
int writeCGNSFiles;
/** \brief write the restart file during in-memory data transfer
between phasta and chef. */
int writeRestartFiles;
Expand Down
2 changes: 1 addition & 1 deletion phasta/phOutput.h
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 172,7 @@ struct Output

void generateOutput(Input& in, BCs& bcs, apf::Mesh* mesh, Output& o);
void writeGeomBC(Output& o, std::string path, int timestep_or_dat = 0);
void writeCGNSgbc(Output& o, std::string path, int timestep_or_dat = 0);
void writeCGNS(Output& o, std::string path);

}

Expand Down