Skip to content

add reaction diffusion - #96

Closed
weiwongg wants to merge 2 commits into
temf:masterfrom
weiwongg:ReactionDiffusion
Closed

add reaction diffusion#96
weiwongg wants to merge 2 commits into
temf:masterfrom
weiwongg:ReactionDiffusion

Conversation

@weiwongg

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a Gray–Scott reaction–diffusion example to the examples/ suite and introduces a small LinearForm-side helper to assemble the nonlinear reaction term needed by the example. It extends the examples build list accordingly and exposes the new helper through the public Bembel/LinearForm module include.

Changes:

  • Add new examples/GrayScott.cpp reaction–diffusion (Gray–Scott) example and VTK export.
  • Add Bembel/src/LinearForm/ReactionTerm.hpp with a helper to assemble the reaction linear form.
  • Register GrayScott in examples/CMakeLists.txt and export the new header via Bembel/LinearForm.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 5 comments.

File Description
examples/GrayScott.cpp New Gray–Scott reaction–diffusion example using Laplace–Beltrami + mass matrix time stepping and VTK output.
examples/CMakeLists.txt Adds GrayScott to the examples target list.
Bembel/src/LinearForm/ReactionTerm.hpp Introduces reaction-term linear form assembly helper used by the example.
Bembel/LinearForm Exposes the new reaction-term header through the LinearForm module include.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread examples/GrayScott.cpp
for (int i = 0; i < 20000; ++i) {
// Right hand side
Eigen::VectorXd reaction_term;
reactionLinearFrom(ansatz_space_lb, u, v, reaction, &reaction_term);
Comment thread examples/GrayScott.cpp
geometry, refinement_level, polynomial_degree);
// Gray Scott Model
// u_t = r_u * \laplacian u -uv^2 + f(1-u)
// v_y = r_v * \laplacian v +uv^2 - (f+k)v
Comment thread examples/GrayScott.cpp
#include <Eigen/Dense>
#include <iostream>

#include <Bembel/src/util/surfaceL2error.hpp>
Comment on lines +18 to +22
* \brief This class takes care of the
* assembly of the linear form of the reaction term, i.e., uv^2.
*/
template <typename Derived, typename Scalar, typename Functor>
void reactionLinearFrom(const AnsatzSpace<Derived> &ansatz_space,
Comment on lines +49 to +53
const auto &s = qp.segment<2>(0);
// get quadrature weights
Scalar ws = qp(2);
// get points on geometry and tangential derivatives
const auto &x_f = qp.segment<3>(3);
@jdoelz

jdoelz commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

I have moved this pull request to #106 and am closing this one.

@jdoelz jdoelz closed this Jul 24, 2026
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.

4 participants