Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sorting out boundary conditions #28

Merged
merged 7 commits into from
Mar 4, 2024
Merged

Sorting out boundary conditions #28

merged 7 commits into from
Mar 4, 2024

Conversation

dreamer2368
Copy link
Collaborator

@dreamer2368 dreamer2368 commented Mar 2, 2024

  • The enumeration BoundaryType is now independent, applicable to all problems.
    • BoundaryType::ZERO is reserved for zero Dirichlet boundary condition.
  • MultiBlockSolver has Array<BoundaryType> bdr_type, indicating boundary types for all global boundary attributes.
  • MultiBlockSolver::SetParameterizedProblem specifies bdr_type according to problem. Executed in all derived classes.
  • All physics solvers' SetupBCOperator now supports various boundary conditions depending on Dirichlet/Neumann boundary types, specified by member variable bdr_type.
  • MultiBlockSolver::BCExistsOnBdr still behaves the same as before, returning whether a boundary condition is specified.

@dreamer2368 dreamer2368 changed the title Bc handling Sorting out boundary conditions Mar 2, 2024
@dreamer2368 dreamer2368 marked this pull request as ready for review March 2, 2024 02:30
@larsson4
Copy link
Collaborator

larsson4 commented Mar 4, 2024

This needs some modifications for the linear elasticity parameterized problem to work.
Can we add a ZERO_NEUMANN type? I think that would be nice.

@@ -427,14 +428,20 @@ void LinElastSolver::SetupDomainBCOperators()
continue;
if (!BCExistsOnBdr(b))
continue;
as[m]->AddBdrFaceIntegrator(new DGElasticityIntegrator(*(lambda_c[m]), *(mu_c[m]), alpha, kappa), *(bdr_markers[b]));

if (bdr_type[b] == BoundaryType::DIRICHLET)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should also be true for the Zero Neumann condition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you sure about this? zero Neumann condition will be filtered out at the previous if clause, both previous and current version.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think that you're right. The examples all seem to work well now.

src/linelast_solver.cpp Outdated Show resolved Hide resolved
Copy link
Collaborator

@larsson4 larsson4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@@ -427,14 +428,20 @@ void LinElastSolver::SetupDomainBCOperators()
continue;
if (!BCExistsOnBdr(b))
continue;
as[m]->AddBdrFaceIntegrator(new DGElasticityIntegrator(*(lambda_c[m]), *(mu_c[m]), alpha, kappa), *(bdr_markers[b]));

if (bdr_type[b] == BoundaryType::DIRICHLET)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No I think that you're right. The examples all seem to work well now.

@dreamer2368 dreamer2368 merged commit 6fa043d into main Mar 4, 2024
2 checks passed
@dreamer2368 dreamer2368 deleted the bc-handling branch July 9, 2024 20:15
@dreamer2368 dreamer2368 restored the bc-handling branch July 9, 2024 20:15
@dreamer2368 dreamer2368 deleted the bc-handling branch July 9, 2024 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants