Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions include/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class Reader {
json materialProperties;
double TOL;
json errorParameters;
json microstructure;
int n_it;
vector<vector<vector<double>>> g0;
string problemType;
Expand Down
2 changes: 1 addition & 1 deletion include/solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ void Solver<howmany>::postprocess(Reader reader, const char resultsFileName[], i
}

// Concatenate reader.ms_datasetname and reader.results_prefix into reader.ms_datasetname
strcat(reader.ms_datasetname, "/");
strcat(reader.ms_datasetname, "_results/");
strcat(reader.ms_datasetname, reader.results_prefix);

// Write results to results h5 file
Expand Down
8 changes: 4 additions & 4 deletions src/reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,17 @@ void Reader ::ReadInputFile(char fn[])
json j;
i >> j;

strcpy(ms_filename, j["ms_filename"].get<string>().c_str());
strcpy(ms_datasetname, j["ms_datasetname"].get<string>().c_str());
microstructure = j["microstructure"];
strcpy(ms_filename, microstructure["filepath"].get<string>().c_str());
strcpy(ms_datasetname, microstructure["datasetname"].get<string>().c_str());
L = microstructure["L"].get<vector<double>>();

if (j.contains("results_prefix")) {
strcpy(results_prefix, j["results_prefix"].get<string>().c_str());
} else {
strcpy(results_prefix, "");
}

L = j["ms_L"].get<vector<double>>();

errorParameters = j["error_parameters"];
TOL = errorParameters["tolerance"].get<double>();
n_it = j["n_it"].get<int>();
Expand Down
8 changes: 5 additions & 3 deletions test/input_files/test_J2Plasticity.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ms_filename": "microstructures/sphere32.h5",
"ms_datasetname": "/sphere/32x32x32/ms",
"ms_L": [1.0, 1.0, 1.0],
"microstructure": {
"filepath": "microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
},

"problem_type": "mechanical",
"matmodel": "J2ViscoPlastic_NonLinearIsotropicHardening",
Expand Down
8 changes: 5 additions & 3 deletions test/input_files/test_LinearElastic.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ms_filename": "microstructures/sphere32.h5",
"ms_datasetname": "/sphere/32x32x32/ms",
"ms_L": [1.0, 1.0, 1.0],
"microstructure": {
"filepath": "microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
},

"problem_type": "mechanical",
"matmodel": "LinearElasticIsotropic",
Expand Down
8 changes: 5 additions & 3 deletions test/input_files/test_LinearThermal.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ms_filename": "microstructures/sphere32.h5",
"ms_datasetname": "/sphere/32x32x32/ms",
"ms_L": [1.0, 1.0, 1.0],
"microstructure": {
"filepath": "microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
},

"problem_type": "thermal",
"matmodel": "LinearThermalIsotropic",
Expand Down
8 changes: 5 additions & 3 deletions test/input_files/test_PseudoPlastic.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ms_filename": "microstructures/sphere32.h5",
"ms_datasetname": "/sphere/32x32x32/ms",
"ms_L": [1.0, 1.0, 1.0],
"microstructure": {
"filepath": "microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
},

"problem_type": "mechanical",
"matmodel": "PseudoPlasticNonLinearHardening",
Expand Down
8 changes: 5 additions & 3 deletions test/test_pyfans/input.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"ms_filename": "../microstructures/sphere32.h5",
"ms_datasetname": "/sphere/32x32x32/ms",
"ms_L": [1.0, 1.0, 1.0],
"microstructure": {
"filepath": "../microstructures/sphere32.h5",
"datasetname": "/sphere/32x32x32/ms",
"L": [1.0, 1.0, 1.0]
},

"problem_type": "mechanical",
"matmodel": "LinearElasticIsotropic",
Expand Down