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

Please add an example on how to add new BC keyword #45

Closed
Trophime opened this issue Apr 8, 2022 · 2 comments
Closed

Please add an example on how to add new BC keyword #45

Trophime opened this issue Apr 8, 2022 · 2 comments

Comments

@Trophime
Copy link
Member

Trophime commented Apr 8, 2022

Hi,
@prudhomm @vincentchabannes @romainhild
would it be possible to add an example on how to implement new BC conditions?
I'm thinking of BiotSavart , for instance, to compute Dirichlet conditions from a given formula or a call to a dedicated library.

@romainhild
Copy link
Contributor

romainhild commented Apr 8, 2022

The easier I think is to add it directly in the lambda function.
Something like:

if ( tb->modelProperties().boundaryConditions().hasSection( tb->keyword() ) )
{
  auto jarg = tb->modelProperties().boundaryConditions().section( tb->keyword() );
  if ( jarg.contains( "mynewbc" ) )
  {
    auto const& j_bc = jarg.at( "mynewbc" );
    for ( auto const& [j_bckey,j_bcval] : j_bc.items() )
    {
      // here implement your boundary condition
      // j_bckey is the name of one bc of type "mynewbc"
      // j_bcval is the json section where you can have anything you want (markers, expr, path to a script to run,...)
    }
  }
}

@prudhomm
Copy link
Member

@Trophime this is done in src/

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

No branches or pull requests

3 participants