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

Explicitly check the result of a dynamic_cast. #6132

Merged
merged 1 commit into from Apr 1, 2018

Conversation

drwells
Copy link
Member

@drwells drwells commented Mar 31, 2018

Coverity also caught this.

Copy link
Member

@masterleinad masterleinad 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 (apart from the indentation 😉)!

@drwells drwells force-pushed the check-fe-system-dynamic-cast branch from 822ff2a to d44e81c Compare March 31, 2018 23:21
@drwells
Copy link
Member Author

drwells commented Mar 31, 2018

Whoops. I fixed it.

@masterleinad
Copy link
Member

/run-tests

@davydden davydden merged commit 98654a2 into dealii:master Apr 1, 2018
@bangerth
Copy link
Member

bangerth commented Apr 1, 2018

This patch yields the wrong exception. The documentation of the function states:

  /**
   * Return the matrix interpolating from a face of one element to the
   * subface of the neighboring element.  The size of the matrix is then
   * <tt>source.#dofs_per_face</tt> times <tt>this->#dofs_per_face</tt>.
   *
   * Derived elements will have to implement this function. They may only
   * provide interpolation matrices for certain source finite elements, for
   * example those from the same family. If they don't implement interpolation
   * from a given element, then they must throw an exception of type
   * ExcInterpolationNotImplemented.
   */
  virtual void
  get_subface_interpolation_matrix (const FiniteElement<dim,spacedim> &source,
                                    const unsigned int        subface,
                                    FullMatrix<double>       &matrix) const;

This means that the exception thrown after this patch does not match the description.

Can you fix this?

@drwells drwells mentioned this pull request Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants