Skip to content

Commit

Permalink
Fix an issue when using linear elements and constant vel grad BCs
Browse files Browse the repository at this point in the history
  • Loading branch information
rcarson3 committed Jul 14, 2024
1 parent 96914a9 commit d00500c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
17 changes: 9 additions & 8 deletions src/mechanics_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ int main(int argc, char *argv[])
if (mesh_order > toml_opt.order) {
toml_opt.order = mesh_order;
}
if (mesh_order < toml_opt.order) {
if (mesh_order <= toml_opt.order) {
if (myid == 0) {
printf("Increasing the order of the mesh to %d\n", toml_opt.order);
}
Expand Down Expand Up @@ -601,6 +601,14 @@ int main(int argc, char *argv[])
q_vonMises.UseDevice(true);
matProps.UseDevice(true);

{
// fix me: should the mesh nodes be on the device?
GridFunction *nodes = &x_cur; // set a nodes grid function to global current configuration
int owns_nodes = 0;
pmesh->SwapNodes(nodes, owns_nodes); // pmesh has current configuration nodes
nodes = NULL;
}

SystemDriver oper(fe_space,
toml_opt, matVars0,
matVars1, sigma0, sigma1, matGrd,
Expand Down Expand Up @@ -824,13 +832,6 @@ int main(int argc, char *argv[])
oper.SetTime(t);

bool last_step = false;
{
// fix me: should the mesh nodes be on the device?
GridFunction *nodes = &x_cur; // set a nodes grid function to global current configuration
int owns_nodes = 0;
pmesh->SwapNodes(nodes, owns_nodes); // pmesh has current configuration nodes
nodes = NULL;
}

double dt_real;

Expand Down
4 changes: 2 additions & 2 deletions src/mechanics_operator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,14 @@ NonlinearMechOperator::NonlinearMechOperator(ParFiniteElementSpace &fes,
diag.SetSize(fe_space.GetTrueVSize(), Device::GetMemoryType());
diag.UseDevice(true);
diag = 1.0;
prec_oper = new MechOperatorJacobiSmoother(diag, Hform->GetEssentialTrueDofs());
prec_oper = new MechOperatorJacobiSmoother(diag, this->GetEssentialTrueDofs());
}
else if (assembly == Assembly::EA) {
Hform->SetAssemblyLevel(mfem::AssemblyLevel::ELEMENT, ElementDofOrdering::NATIVE);
diag.SetSize(fe_space.GetTrueVSize(), Device::GetMemoryType());
diag.UseDevice(true);
diag = 1.0;
prec_oper = new MechOperatorJacobiSmoother(diag, Hform->GetEssentialTrueDofs());
prec_oper = new MechOperatorJacobiSmoother(diag, this->GetEssentialTrueDofs());
}

// So, we're going to originally support non tensor-product type elements originally.
Expand Down

0 comments on commit d00500c

Please sign in to comment.