Skip to content

Commit

Permalink
verification of the piece of code to share atom dump for similar QPs
Browse files Browse the repository at this point in the history
  • Loading branch information
mvassaux committed Apr 27, 2020
1 parent f101ed1 commit 004cf81
Show file tree
Hide file tree
Showing 6 changed files with 311 additions and 295 deletions.
6 changes: 3 additions & 3 deletions clustering/coarsegrain_dependency_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ def coarsegrain_dependency_network(input_folder, out_mapping_fname, num_gps):
for i, mapp in enumerate(mapping):
outfile_map.write(str(i) + " " + str(mapp) + "\n");

print("Converged in", iterations, "iterations")
print("Number of gauss points to be udpated: ", num_gp_tbu)
print("Number of simulations required: ", num_gp_tbu-neighbour_removed)
print(" Converged in", iterations, "iterations")
print(" Number of gauss points to be udpated: ", num_gp_tbu)
print(" Number of simulations required: ", num_gp_tbu-neighbour_removed)


if __name__ == "__main__":
Expand Down
15 changes: 7 additions & 8 deletions headers/FE_problem.h
Original file line number Diff line number Diff line change
Expand Up @@ -1093,9 +1093,9 @@ namespace HMM
local_quadrature_points_history[q].new_strain[0][1],
local_quadrature_points_history[q].new_strain[0][2],
local_quadrature_points_history[q].new_strain[1][2]);
// remember the last ID used to get results from
local_quadrature_points_history[q].hist_strain.set_most_recent_ID_to_get_results_from(local_quadrature_points_history[q].hist_strain.get_ID_to_update_from());
// Default to get results from self
// remember the last ID used to get results from (WARNING: what about first timestep?)
local_quadrature_points_history[q].hist_strain.set_most_recent_ID_to_get_results_from(local_quadrature_points_history[q].hist_strain.get_ID_to_get_results_from());
// Default to get results from self
local_quadrature_points_history[q].hist_strain.set_ID_to_get_results_from(local_quadrature_points_history[q].qpid);
}
}
Expand Down Expand Up @@ -1273,7 +1273,7 @@ namespace HMM

// might be interesting to set them global and not reload them at every iteration?
num_spline_points = input_config.get<int>("model precision.clustering.spline points");
min_num_steps_before_spline = input_config.get<int>("model precision.clustering.min steps");
min_num_steps_before_spline = input_config.get<int>("model precision.clustering.min steps");
acceptable_diff_threshold = input_config.get<double>("model precision.clustering.diff threshold");
clusteringscriptsloc = input_config.get<std::string>("model precision.clustering.scripts directory");

Expand Down Expand Up @@ -1339,7 +1339,7 @@ namespace HMM
qp.update_strain[i] = rot_avg_upd_strain_tensor.access_raw_entry(i);
}
qp.id = local_quadrature_points_history[q].qpid;
qp.most_recent_id = local_quadrature_points_history[q].hist_strain.get_most_recent_ID_to_update_from();
qp.most_recent_id = local_quadrature_points_history[q].hist_strain.get_most_recent_ID_to_get_results_from();
qp.material = celldata.get_composition(cell->active_cell_index());
scale_bridging_data.update_list.push_back(qp);
//sprintf(filename, "%s/last.%s.upstrain", macrostatelocout.c_str(), cell_id);
Expand Down Expand Up @@ -1516,8 +1516,7 @@ namespace HMM

for (unsigned int q=0; q<quadrature_formula.size(); ++q)
{
char cell_id[1024]; sprintf(cell_id, "%d", local_quadrature_points_history[q].hist_strain.get_ID_to_update_from());
int qp_id = local_quadrature_points_history[q].hist_strain.get_ID_to_update_from();
int qp_id = local_quadrature_points_history[q].hist_strain.get_ID_to_get_results_from();

if (newtonstep == 0) local_quadrature_points_history[q].inc_stress = 0.;

Expand Down Expand Up @@ -1817,7 +1816,7 @@ namespace HMM
}

std::ofstream ofile;
char fname[1024]; sprintf(fname, "%s/resultforce.csv", macrologloc.c_str());
char fname[1024]; sprintf(fname, "%s/loadedbc_force.csv", macrologloc.c_str());

// writing the header of the file
if (timestep == start_timestep){
Expand Down
2 changes: 1 addition & 1 deletion headers/scale_bridging_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace HMM {
struct QP // quadradture point
{
int id;
int most_recent_id;
int most_recent_id;
int material;
double update_strain[6];
double update_stress[6];
Expand Down
Loading

0 comments on commit 004cf81

Please sign in to comment.