Skip to content

Commit

Permalink
Update demos
Browse files Browse the repository at this point in the history
  • Loading branch information
garth-wells committed Jun 9, 2024
1 parent db3a1d5 commit 5a2e2c5
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
5 changes: 3 additions & 2 deletions cpp/demos/meshtie/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,11 +173,12 @@ int main(int argc, char* argv[])
auto contact_markers
= std::make_shared<dolfinx::graph::AdjacencyList<std::int32_t>>(
std::move(data), std::move(offsets));
std::vector<std::shared_ptr<dolfinx::mesh::MeshTags<std::int32_t>>> markers
std::vector<std::shared_ptr<const dolfinx::mesh::MeshTags<std::int32_t>>>
markers
= {std::make_shared<dolfinx::mesh::MeshTags<std::int32_t>>(facet1)};
std::vector<std::array<int, 2>> pairs = {{0, 1}, {1, 0}};
auto meshties
= dolfinx_contact::MeshTie(markers, contact_markers, pairs, mesh, 5);
= dolfinx_contact::MeshTie(markers, *contact_markers, pairs, mesh, 5);

meshties.generate_kernel_data(dolfinx_contact::Problem::Elasticity, *V,
{{"mu", mu}, {"lambda", lmbda}}, E * gamma,
Expand Down
5 changes: 3 additions & 2 deletions cpp/demos/meshtieHeatEquation/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -105,11 +105,12 @@ int main(int argc, char* argv[])
auto contact_markers
= std::make_shared<dolfinx::graph::AdjacencyList<std::int32_t>>(
std::move(data), std::move(offsets));
std::vector<std::shared_ptr<dolfinx::mesh::MeshTags<std::int32_t>>> markers
std::vector<std::shared_ptr<const dolfinx::mesh::MeshTags<std::int32_t>>>
markers
= {std::make_shared<dolfinx::mesh::MeshTags<std::int32_t>>(facet1)};
std::vector<std::array<int, 2>> pairs = {{0, 1}, {1, 0}};
auto meshties
= dolfinx_contact::MeshTie(markers, contact_markers, pairs, mesh, 5);
= dolfinx_contact::MeshTie(markers, *contact_markers, pairs, mesh, 5);

meshties.generate_kernel_data(dolfinx_contact::Problem::Poisson, *Q,
{{"kdt", kdt}}, gamma, theta);
Expand Down
5 changes: 3 additions & 2 deletions cpp/demos/meshtieHeatTransfer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,14 +257,15 @@ int main(int argc, char* argv[])
= std::make_shared<dolfinx::graph::AdjacencyList<std::int32_t>>(
std::move(data), std::move(offsets));
// wrap facet markers
std::vector<std::shared_ptr<dolfinx::mesh::MeshTags<std::int32_t>>> markers
std::vector<std::shared_ptr<const dolfinx::mesh::MeshTags<std::int32_t>>>
markers
= {std::make_shared<dolfinx::mesh::MeshTags<std::int32_t>>(facet1)};
// define pairs (slave, master)
std::vector<std::array<int, 2>> pairs = {{0, 1}, {1, 0}};

// create meshties
auto meshties = std::make_shared<dolfinx_contact::MeshTie>(
dolfinx_contact::MeshTie(markers, contact_markers, pairs, mesh, 5));
dolfinx_contact::MeshTie(markers, *contact_markers, pairs, mesh, 5));

// Nitsche parameters
double gamma = 10;
Expand Down
5 changes: 3 additions & 2 deletions cpp/demos/meshtieNewton/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,15 @@ int main(int argc, char* argv[])
= std::make_shared<dolfinx::graph::AdjacencyList<std::int32_t>>(
std::move(data), std::move(offsets));
// wrap facet markers
std::vector<std::shared_ptr<dolfinx::mesh::MeshTags<std::int32_t>>> markers
std::vector<std::shared_ptr<const dolfinx::mesh::MeshTags<std::int32_t>>>
markers
= {std::make_shared<dolfinx::mesh::MeshTags<std::int32_t>>(facet1)};
// define pairs (slave, master)
std::vector<std::array<int, 2>> pairs = {{0, 1}, {1, 0}};

// create meshties
auto meshties = std::make_shared<dolfinx_contact::MeshTie>(
dolfinx_contact::MeshTie(markers, contact_markers, pairs, mesh, 5));
dolfinx_contact::MeshTie(markers, *contact_markers, pairs, mesh, 5));

// create "non-linear" meshtie problem (linear problem written as non-linear
// problem)
Expand Down

0 comments on commit 5a2e2c5

Please sign in to comment.