10 #include "gtest/gtest.h" 34 const char * argv[2] = {
"foo",
"\0"};
45 moose_mesh->
setMeshBase(moose_mesh->buildMeshBaseObject(2));
46 moose_mesh->buildMesh();
47 _app->actionWarehouse().mesh() = moose_mesh;
52 const std::string & formulation =
"kinematic")
54 auto params =
_app->getActionFactory().getValidParams(
"ContactAction");
55 params.set<std::string>(
"task") =
"add_constraint";
56 params.set<std::string>(
"registered_identifier") =
"Contact/*";
57 params.set<std::vector<BoundaryName>>(
"primary") = {
"primary"};
58 params.set<std::vector<BoundaryName>>(
"secondary") = {
"secondary"};
61 params.set_attributes(
"formulation",
false);
62 params.set<
MooseEnum>(
"formulation") = formulation;
65 switch (ghost_whole_interface)
70 params.set_attributes(
"ghost_whole_interface",
false);
71 params.set<
bool>(
"ghost_whole_interface") =
false;
74 params.set_attributes(
"ghost_whole_interface",
false);
75 params.set<
bool>(
"ghost_whole_interface") =
true;
79 auto action =
_app->getActionFactory().create(
"ContactAction",
"Contact/test", params);
91 const auto & relationship_managers =
_app->relationshipManagers();
92 ASSERT_EQ(relationship_managers.size(), 1);
94 auto & rm = **relationship_managers.begin();
95 EXPECT_EQ(rm.type(),
"GhostPrimaryFace");
98 EXPECT_EQ(rm.attachGeometricEarly(), !enabled);
99 EXPECT_EQ(rm.getInfo(), enabled ?
"GhostPrimaryFace" :
"GhostPrimaryFace (disabled)");
104 const std::string error =
105 "Mortar contact always geometrically and algebraically ghosts the interface.";
106 EXPECT_THROW_MSG_CONTAINS(
113 std::shared_ptr<MooseApp>
_app;
119 testContactActionRelationshipManager(
false);
124 testContactActionRelationshipManager(
true);
129 testMortarContactActionRejectsGhostWholeInterface(
"mortar");
134 testMortarContactActionRejectsGhostWholeInterface(
"mortar_penalty");
std::shared_ptr< MooseObject > create(const std::string &obj_name, const std::string &name, const InputParameters ¶meters, THREAD_ID tid=0, bool print_deprecated=true)
InputParameters getValidParams(const std::string &name) const
void setMeshBase(std::unique_ptr< MeshBase > mesh_base)
std::unique_ptr< MooseApp > createMooseApp(const std::string &default_app_type, int argc, char *argv[])