Skip to content

Commit

Permalink
3d bc dup (goma#451)
Browse files Browse the repository at this point in the history
* Add flag for 3D BC duplication printing

* add doc file

* try to fix docs
  • Loading branch information
wortiz authored Feb 9, 2024
1 parent c47fda7 commit 508984a
Show file tree
Hide file tree
Showing 8 changed files with 70 additions and 13 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/doc-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Setup Python
uses: actions/setup-python@v4
Expand All @@ -25,7 +25,7 @@ jobs:
run: echo "::set-output name=dir::$(pip cache dir)"

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ steps.pip-cache.outputs.dir }}
key: ${{ runner.os }}-pip-${{ hashFiles('**/Pipefile') }}
Expand Down
1 change: 1 addition & 0 deletions docs/problem_description_file/general_specifications.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ below.

general_specifications/output_level
general_specifications/debug
general_specifications/print_3d_bc_dup
general_specifications/number_of_jacobian_file_dumps
general_specifications/initial_guess
general_specifications/initialize
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
****************
Print 3D BC Dup
****************

::

Print 3D BC Dup = <integer>

-----------------------
Description / Usage
-----------------------

This optional card specifies the level of information output to the 3D BC dup file "bc3D_output.txt"

.. tabularcolumns:: |l|L|

============== ===============================================================
Level Results Output
============== ===============================================================
0 No output (default).
1 BC Duplication information
2 Same as level 1 with additional rotation and node Duplication
debugging
============== ===============================================================


------------
Examples
------------

Following is a sample card:
::

Print 3D BC Dup = 1


-------------------------
Technical Discussion
-------------------------
1 change: 1 addition & 0 deletions include/rf_solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ extern int LOCA_UMF_ID; /* UMFPACK SYSTEM ID */
extern int Max_Newton_Steps; /* Maximum number of Newton steps to take. */
extern int Guess_Flag; /* Indicates the type of initial guess */
extern int Conformation_Flag; /* Indicates mapping from stress to log-conformation tensor */
extern int Print3DBCDup;

extern double damp_factor;
extern double damp_factor1; /* Relaxation factor for Newton iteration */
Expand Down
1 change: 1 addition & 0 deletions src/dp_vif.c
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ void noahs_ark(void) {
#endif
ddd_add_member(n, &Guess_Flag, 1, MPI_INT);
ddd_add_member(n, &Conformation_Flag, 1, MPI_INT);
ddd_add_member(n, &Print3DBCDup, 1, MPI_INT);

/*
* The variable initialization structures are of fixed size, but only
Expand Down
1 change: 1 addition & 0 deletions src/globals.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ int LOCA_UMF_ID; /* UMFPACK SYSTEM ID */
int Max_Newton_Steps; /* Maximum number of Newton steps to take. */
int Guess_Flag; /* Indicates the type of initial guess */
int Conformation_Flag; /* Indicates mapping from stress to log-conformation tensor */
int Print3DBCDup;

double damp_factor;
double damp_factor1; /* Relaxation factor for Newton iteration */
Expand Down
23 changes: 12 additions & 11 deletions src/mm_bc_conflict.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "rf_io_const.h"
#include "rf_mp.h"
#include "rf_node_const.h"
#include "rf_solver.h"
#include "rf_vars_const.h"
#include "std.h"
#ifndef MAX_NODAL_BCS
Expand Down Expand Up @@ -2531,7 +2532,7 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
* BC_list
*/
BC_dup_ptr[pg->imtrx]++;
if (Debug_Flag > 1 && Unlimited_Output) {
if ((Print3DBCDup > 1 || Debug_Flag > 1) && Unlimited_Output) {
fprintf(ofbc, "New Rot node in dup list %d %d\n", inode + 1,
BC_dup_ptr[pg->imtrx]);
}
Expand Down Expand Up @@ -2709,24 +2710,24 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
BC_dup_nodes[pg->imtrx][BC_dup_ptr[pg->imtrx]] = inode;
BC_dup_list[pg->imtrx][BC_dup_ptr[pg->imtrx]] = BC_Unk_List[inode];
BC_dup_ptr[pg->imtrx]++;
if (Debug_Flag > 1 && Unlimited_Output) {
if ((Print3DBCDup > 1 || Debug_Flag > 1) && Unlimited_Output) {
fprintf(ofbc, "New node in duplication list %d %d\n", inode + 1,
BC_dup_ptr[pg->imtrx]);
}
}

idup = 0;
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " DUPLICATE BC at node %d equation %d: ", inode + 1, eqn);
}
while (BC_Unk_List[inode][offset][idup] != -1) {
ibc = BC_Unk_List[inode][offset][idup];
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, "%s, ", BC_Types[ibc].desc->name2);
}
idup++;
}
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, "\n");
}

Expand Down Expand Up @@ -2786,7 +2787,7 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
ibc2 = BC_Unk_List[inode][offset][j_DC];
bct2 = BC_Types[ibc2].BC_Name;
/* RESOLVE CONFLICT */
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
ibc = BC_Unk_List[inode][offset][j_DC];
fprintf(ofbc, " TWO DBC's %s and %s at node %d \n",
BC_Types[ibc1].desc->name2, BC_Types[ibc].desc->name2, inode + 1);
Expand Down Expand Up @@ -2817,20 +2818,20 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
if ((bct1 <= GD_TIME_BC && bct1 >= GD_CONST_BC) &&
(bct2 <= GD_TIME_BC && bct2 >= GD_CONST_BC)) {
if (BC_Types[ibc1].BC_ID == BC_Types[ibc2].BC_ID) {
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " MULTIPLE GD %s at node %d\n",
BC_Types[ibc2].desc->name2, inode + 1);
}
save_this_bc[j] = 1;
} else {
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " REMOVE %s in favor of %s at node %d\n",
BC_Types[ibc2].desc->name2, BC_Types[ibc1].desc->name2,
inode + 1);
}
}
} else {
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " REMOVE %s in favor of %s at node %d\n",
BC_Types[ibc2].desc->name2, BC_Types[ibc1].desc->name2,
inode + 1);
Expand All @@ -2854,7 +2855,7 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
ibc2 = BC_Unk_List[inode][offset][j_SI];
bct2 = BC_Types[ibc2].BC_Name;
/* RESOLVE CONFLICT */
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " REMOVE %s in favor of %s at node %d\n",
BC_Types[ibc2].desc->name2, BC_Types[ibc1].desc->name2,
inode + 1);
Expand All @@ -2878,7 +2879,7 @@ void check_for_bc_conflicts3D(Exo_DB *exo, Dpi *dpi)
if (j_CSWI != -1) {
ibc2 = BC_Unk_List[inode][offset][j_CSWI];
bct2 = BC_Types[ibc2].BC_Name;
if (Debug_Flag > 0 && Unlimited_Output) {
if ((Print3DBCDup > 0 || Debug_Flag > 0) && Unlimited_Output) {
fprintf(ofbc, " REMOVE %s in favor of %s at node %d\n",
BC_Types[ibc1].desc->name2, BC_Types[ibc2].desc->name2,
inode + 1);
Expand Down
13 changes: 13 additions & 0 deletions src/mm_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,19 @@ void rd_genl_specs(FILE *ifp, char *input) {
snprintf(echo_string, MAX_CHAR_ECHO_INPUT, "%s = %d", "Debug", Debug_Flag);
ECHO(echo_string, echo_file);

iread = look_for_optional(ifp, "Print 3D BC Dup", input, '=');
if (iread == 1) {
if (fscanf(ifp, "%d", &Print3DBCDup) != 1) {
DPRINTF(stderr, "%s:\tError reading Print 3D BC Dup Level\n", yo);
exit(-1);
}
} else {
Print3DBCDup = 0;
}

snprintf(echo_string, MAX_CHAR_ECHO_INPUT, "%s = %d", "Debug", Debug_Flag);
ECHO(echo_string, echo_file);

#ifdef MATRIX_DUMP
(void)look_for_optional_int(ifp, "Number of Jacobian File Dumps", &Number_Jac_Dump, 0);

Expand Down

0 comments on commit 508984a

Please sign in to comment.