Commit 5818d7dc authored by Guido Giuntoli's avatar Guido Giuntoli

Adding a counter for integration point types

parent 8bb43b8f
......@@ -174,11 +174,20 @@ static map<int, std::string> micro_names = {
*
*/
enum {
FE_LINEAR,
FE_ONE_WAY,
FE_FULL,
MIXTURE_RULE_CHAMIS
FE_LINEAR,
FE_ONE_WAY,
FE_FULL,
MIX_RULE_CHAMIS
};
static map<int, int> gp_counter = {
{FE_LINEAR, 0},
{FE_ONE_WAY, 0},
{FE_FULL, 0},
{MIX_RULE_CHAMIS, 0}
};
......@@ -235,12 +244,6 @@ class micropp {
const bool lin_stress;
/* Number of micro-problems depending on the type */
int num_fe_linear = 0;
int num_fe_one_way = 0;
int num_fe_full = 0;
int num_fe_points = 0;
/* Linear jacobian for optimization */
bool use_A0;
int its_with_A0;
......
......@@ -88,7 +88,7 @@ void micropp<tdim>::homogenize()
gp_t<tdim> *gp_ptr = &gp_list[igp];
if (gp_ptr->coupling == FE_LINEAR ||
gp_ptr->coupling == MIXTURE_RULE_CHAMIS) {
gp_ptr->coupling == MIX_RULE_CHAMIS) {
/*
* Computational cheap calculation
......
......@@ -81,24 +81,12 @@ micropp<tdim>::micropp(const micropp_params_t &params):
for (int gp = 0; gp < ngp; ++gp) {
if(params.coupling != nullptr) {
gp_list[gp].coupling = params.coupling[gp];
switch (params.coupling[gp]) {
case FE_LINEAR:
num_fe_linear ++;
break;
case FE_ONE_WAY:
num_fe_one_way ++;
break;
case FE_FULL:
num_fe_full ++;
break;
}
gp_counter[gp_list[gp].coupling] ++;
} else {
gp_list[gp].coupling = FE_ONE_WAY;
num_fe_one_way ++;
gp_counter[gp_list[gp].coupling] ++;
}
num_fe_points = num_fe_linear + num_fe_one_way + num_fe_full;
gp_list[gp].nndim = nndim;
gp_list[gp].nvars = nvars;
......@@ -153,6 +141,7 @@ micropp<tdim>::micropp(const micropp_params_t &params):
memset(ctan_lin_fe, 0.0, nvoi * nvoi * sizeof(double));
if (calc_ctan_lin_flag) {
int num_fe_points = gp_counter[FE_LINEAR] + gp_counter[FE_ONE_WAY] + gp_counter[FE_FULL];
if (num_fe_points > 0) {
calc_ctan_lin_fe_models();
}
......@@ -165,7 +154,7 @@ micropp<tdim>::micropp(const micropp_params_t &params):
memcpy(gp_list[gp].ctan, ctan_lin_fe, nvoi * nvoi * sizeof(double));
} else if (gp_list[gp].coupling == MIXTURE_RULE_CHAMIS) {
} else if (gp_list[gp].coupling == MIX_RULE_CHAMIS) {
double ctan[nvoi * nvoi];
calc_ctan_lin_mixture_rule_Chamis(ctan);
......@@ -829,9 +818,10 @@ void micropp<tdim>::print_info() const
cout << "MATRIX [%] : " << Vm << endl;
cout << "FIBER [%] : " << Vf << endl;
cout << "FE_LINEAR : " << num_fe_linear << " GPs" << endl;
cout << "FE_ONE_WAY : " << num_fe_one_way << " GPs" << endl;
cout << "FE_FULL : " << num_fe_full << " GPs" << endl;
cout << "FE_LINEAR : " << gp_counter[FE_LINEAR] << " GPs" << endl;
cout << "FE_ONE_WAY : " << gp_counter[FE_ONE_WAY] << " GPs" << endl;
cout << "FE_FULL : " << gp_counter[FE_FULL] << " GPs" << endl;
cout << "MIX_RULE_CHAMIS : " << gp_counter[MIX_RULE_CHAMIS] << " GPs" << endl;
cout << "USE A0 : " << use_A0 << endl;
cout << "NUM SUBITS : " << nsubiterations << endl;
cout << "MPI RANK : " << mpi_rank << endl;
......
......@@ -63,7 +63,8 @@ int main(int argc, char **argv)
const double dt = t_final / time_steps;
double time = 0.0;
assert(n > 1 && 0 <= print && print < 2 && time_steps >= 0);
assert(n > 1 && 0 <= print && print < 2 && time_steps >= 0 &&
0 <= coupling && coupling <= MIX_RULE_CHAMIS);
micropp_params_t mic_params;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment