Skip to content

Commit

Permalink
Update contact adjoint after interface changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
tupek2 committed Dec 12, 2024
1 parent c910872 commit 6edbdc7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/serac/physics/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ set(physics_parallel_test_sources
blt_list_append(TO physics_parallel_test_sources
ELEMENTS
contact_patch.cpp
contact_patch_tied.cpp
contact_beam.cpp
contact_solid_adjoint.cpp
IF TRIBOL_FOUND)
Expand Down
6 changes: 3 additions & 3 deletions src/serac/physics/tests/contact_patch_tied.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ TEST_P(ContactPatchTied, patch)
// };
// #elif defined(MFEM_USE_STRUMPACK)
#ifdef MFEM_USE_STRUMPACK
LinearSolverOptions linear_options{.linear_solver = LinearSolver::Strumpack, .print_level = 1};
LinearSolverOptions linear_options{.linear_solver = LinearSolver::Strumpack, .print_level = 0};
#else
LinearSolverOptions linear_options{};
SLIC_INFO_ROOT("Contact requires MFEM built with strumpack.");
Expand All @@ -64,8 +64,8 @@ TEST_P(ContactPatchTied, patch)

NonlinearSolverOptions nonlinear_options{.nonlin_solver = NonlinearSolver::Newton,
.relative_tol = 1.0e-10,
.absolute_tol = 1.0e-10,
.max_iterations = 20,
.absolute_tol = 5.0e-10,
.max_iterations = 25,
.print_level = 1};

ContactOptions contact_options{.method = ContactMethod::SingleMortar,
Expand Down
5 changes: 4 additions & 1 deletion src/serac/physics/tests/contact_solid_adjoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@ std::unique_ptr<SolidMechT> createContactSolver(const NonlinearSolverOptions& no
auto solid =
std::make_unique<SolidMechT>(nonlinear_opts, solid_mechanics::direct_linear_options, dyn_opts,
physics_prefix + std::to_string(iter++), mesh_tag, std::vector<std::string>{}, 0, 0.0, false, true);
solid->setMaterial(mat);


Domain whole_mesh = EntireDomain(StateManager::mesh(mesh_tag));
solid->setMaterial(mat, whole_mesh);

solid->setDisplacementBCs({2}, [](const mfem::Vector& /*X*/, double /*t*/, mfem::Vector& disp) { disp = 0.0; });
solid->setDisplacementBCs({4}, [](const mfem::Vector& /*X*/, double /*t*/, mfem::Vector& disp) {
Expand Down

0 comments on commit 6edbdc7

Please sign in to comment.