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

add method to set BCFunctor internal pointer #150

Open
cwentland0 opened this issue Aug 21, 2023 · 2 comments
Open

add method to set BCFunctor internal pointer #150

cwentland0 opened this issue Aug 21, 2023 · 2 comments

Comments

@cwentland0
Copy link
Collaborator

For assigning Schwarz boundary state and graph pointers, implemented by user BCFunctor class.

cwentland0 added a commit that referenced this issue Aug 21, 2023
@fnrizzi
Copy link
Member

fnrizzi commented Aug 22, 2023

can you please elaborate a bit more about what you mean by "boundary state and graph pointers"?
What is the purpose of doing this:

template <class T>
  void setBCPointer(::pressiodemoapps::impl::GhostRelativeLocation rloc, T* ptr) {
    m_bcFuncsHolder.setInternalPointer(rloc, ptr);
  }

I mean, what is ptr and what is it used for?

@cwentland0
Copy link
Collaborator Author

cwentland0 commented Aug 22, 2023

The Schwarz Dirichlet boundary conditions requires access to a boundary state, and a graph referencing the boundary cell index to the appropriate ghost cell index within the boundary state. This is the same as in the original Schwarz implementation (on the schwarz branch), which used

const auto bcIndex = m_graphBcs(gRow, 0);
      if (bcIndex == -1) {
        m_ghostLeft(gRow, 0) = m_state(uIndex+0);
        m_ghostLeft(gRow, 1) = m_state(uIndex+1);
        m_ghostLeft(gRow, 2) = m_state(uIndex+2);
        m_ghostLeft(gRow, 3) = m_state(uIndex+3);
      }
      else {
        m_ghostLeft(gRow, 0) = m_stateBcs(bcIndex+0);
        m_ghostLeft(gRow, 1) = m_stateBcs(bcIndex+1);
        m_ghostLeft(gRow, 2) = m_stateBcs(bcIndex+2);
        m_ghostLeft(gRow, 3) = m_stateBcs(bcIndex+3);
      }

in conjunction with routines that set those pointers

void setStateBc(state_type * stateBc){
    m_stateBc = stateBc;
  }

  void setGraphBc(graph_type * ghostGraph){
    m_ghostGraph = ghostGraph;
  }

The function you quoted is just a catch-all for whatever similar pointers the user-defined BCFunctor might need to set after initializing the problem.

fnrizzi added a commit that referenced this issue Aug 24, 2023
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

2 participants