commit 236d08acb439485acf02812a6cbaf56820f7245a
parent 53dbac17eff89ec794ce592fea4842ed7207c6ad
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Wed, 23 Sep 2020 11:06:34 +0200
Ascii green output now meets unsteady requirements
Diffstat:
2 files changed, 29 insertions(+), 12 deletions(-)
diff --git a/doc/stardis-output.5.txt b/doc/stardis-output.5.txt
@@ -380,9 +380,9 @@ _______
<sample> ::= <end-spec> <power-count> <flux-count> <power-terms> <flux-terms>
-<solid> ::= <green-id> <name> <lambda> <rho> <cp> <power> <imposed-temp>
+<solid> ::= <green-id> <name> <lambda> <rho> <cp> <power> <initial-temp> <imposed-temp>
-<fluid> ::= <green-id> <name> <rho> <cp> <imposed-temp>
+<fluid> ::= <green-id> <name> <rho> <cp> <initial-temp> <imposed-temp>
<t-bound> ::= <green-id> <name> <temperature>
@@ -403,6 +403,9 @@ _______
<power> ::= REAL # in (-INF , INF)
+<initial-temp> ::= REAL # in [0 , INF)
+ | "NONE" if not imposed
+
<imposed-temp> ::= REAL # in [0 , INF)
| "NONE" if not imposed
diff --git a/src/stardis-output.c b/src/stardis-output.c
@@ -739,37 +739,51 @@ dump_green_ascii
/* List Media */
if(stardis->counts.smed_count) {
fprintf(stream, "# Solids\n");
- fprintf(stream, "# ID Name lambda rho cp power Temp\n");
+ fprintf(stream, "# ID Name lambda rho cp power initial_temp imposed_temp\n");
FOR_EACH(i, 0, szd) {
const struct description* desc = descs + i;
const struct solid* sl;
if(desc->type != DESC_MAT_SOLID) continue;
sl = &desc->d.solid;
+ fprintf(stream, "%u\t%s\t%g\t%g\t%g\t%g",
+ i, str_cget(&sl->name), sl->lambda, sl->rho, sl->cp, sl->vpower);
+ if(sl->tinit >= 0) {
+ fprintf(stream, "\t%g", sl->tinit);
+ } else {
+ fprintf(stream, "\tNONE");
+ }
if(sl->imposed_temperature >= 0) {
- fprintf(stream, "%u\t%s\t%g\t%g\t%g\t%g\t%g\n",
- i, str_cget(&sl->name), sl->lambda, sl->rho, sl->cp, sl->vpower,
- sl->imposed_temperature);
+ fprintf(stream, "\t%g\n", sl->imposed_temperature);
} else {
- fprintf(stream, "%u\t%s\t%g\t%g\t%g\t%g\tNONE\n",
- i, str_cget(&sl->name), sl->lambda, sl->rho, sl->cp, sl->vpower);
+ fprintf(stream, "\tNONE\n");
}
}
}
if(stardis->counts.fmed_count) {
fprintf(stream, "# Fluids\n");
- fprintf(stream, "# ID Name rho cp Temp\n");
+ fprintf(stream, "# ID Name rho cp initial_temp imposed_temp\n");
FOR_EACH(i, 0, szd) {
const struct description* desc = descs + i;
const struct fluid* fl;
if(desc->type != DESC_MAT_FLUID) continue;
fl = &desc->d.fluid;
if(fl->imposed_temperature >= 0) {
- fprintf(stream, "%u\t%s\t%g\t%g\t%g\n",
- i, str_cget(&fl->name), fl->rho, fl->cp, fl->imposed_temperature);
+ fprintf(stream, "%u\t%s\t%g\t%g",
+ i, str_cget(&fl->name), fl->rho, fl->cp);
} else {
- fprintf(stream, "%u\t%s\t%g\t%g\tNONE\n",
+ fprintf(stream, "%u\t%s\t%g\t%g",
i, str_cget(&fl->name), fl->rho, fl->cp);
}
+ if(fl->tinit >= 0) {
+ fprintf(stream, "\t%g", fl->tinit);
+ } else {
+ fprintf(stream, "\tNONE");
+ }
+ if(fl->imposed_temperature >= 0) {
+ fprintf(stream, "\t%g\n", fl->imposed_temperature);
+ } else {
+ fprintf(stream, "\tNONE\n");
+ }
}
}