-
Notifications
You must be signed in to change notification settings - Fork 3
Sandu split Allen-Cahn #142
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| % Process splitting: | ||
| % f = f_diffusion + f_reaction | ||
| % Jacobian = Jacobian_diffusion + Jacobian_reaction | ||
| % | ||
| function du = f_diffusion(~, u, L, alpha, ~, ~) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please rename to fDiffusion, we do not use underscores in OTP |
||
|
|
||
| du = alpha*L*u; | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| % Linear-nonlinear splitting: f = f_linear + f_nonlinear | ||
| % f_linear(u) = Jac*u, f_nonlinear(u) = f(u)-Jac*u | ||
|
|
||
| function du = f_linear(~, u, L, alpha, beta, ~) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fLinear |
||
|
|
||
| du = alpha*L*u + beta * (u - 3*u.^3); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this correct? It looks like it has nonlinear terms.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The goal is to create the splitting
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I see. In that case, I think the names are ok as long as it is documented. Alternatively, you could consider calling them |
||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| % Linear-nonlinear splitting: f = f_linear + f_nonlinear | ||
| % f_linear(u) = Jac*u, f_nonlinear(u) = f(u)-Jac*u | ||
|
|
||
| function du = f_nonlinear(t, u, ~, ~, beta, forcing) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fNonlinear |
||
|
|
||
| du = beta * (u - u.^3) - beta * (u - 3*u.^3) + forcing(t); | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| % Process splitting: | ||
| % f = f_diffusion + f_reaction | ||
| % Jacobian = Jacobian_diffusion + Jacobian_reaction | ||
| % | ||
| function du = f_reaction(t, u, ~, ~, beta, forcing) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. fReaction |
||
|
|
||
| du = beta * (u - u.^3) + forcing(t); | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| % Process splitting: | ||
| % f = f_diffusion + f_reaction | ||
| % Jacobian = Jacobian_diffusion + Jacobian_reaction | ||
| % | ||
| function j = jacobian_diffusion(~, ~, L, alpha, ~, ~) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jacobianDiffusion |
||
|
|
||
| j = alpha*L; | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| % Process splitting: | ||
| % f = f_diffusion + f_reaction | ||
| % Jacobian = Jacobian_diffusion + Jacobian_reaction | ||
| % | ||
| function j = jacobian_reaction(~, u, L, ~, beta, ~) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. jacobianReaction |
||
|
|
||
| j = spdiags(beta * (1 - 3*u.^2), 0, size(L, 1), size(L, 2)); | ||
|
|
||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <deployment-project plugin="plugin.toolbox" plugin-version="1.0"> | ||
| <configuration name="ODE Test Problems" target="target.toolbox" target-name="Package Toolbox"> | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please don't commit this file, so please git revert this file |
||
| <configuration file="/Users/sandu/GIT/GitHub/ODE-Test-Problems/toolboxPackaging.prj" location="/Users/sandu/GIT/GitHub/ODE-Test-Problems" name="toolboxPackaging" target="target.toolbox" target-name="Package Toolbox"> | ||
| <param.appname>ODE Test Problems</param.appname> | ||
| <param.authnamewatermark>Steven Roberts, Andrey A. Popov, Arash Sarshar, Adrian Sandu</param.authnamewatermark> | ||
| <param.email /> | ||
|
|
@@ -14,7 +14,7 @@ | |
| <param.products.version /> | ||
| <param.platforms /> | ||
| <param.guid>0970ed36-a788-484f-beca-105eecd2562a</param.guid> | ||
| <param.exclude.filters></param.exclude.filters> | ||
| <param.exclude.filters /> | ||
| <param.exclude.pcodedmfiles>true</param.exclude.pcodedmfiles> | ||
| <param.examples /> | ||
| <param.demosxml /> | ||
|
|
@@ -85,5 +85,59 @@ | |
| <fileset.depfun.included /> | ||
| <fileset.depfun.excluded /> | ||
| <fileset.package /> | ||
| <build-deliverables> | ||
| <file location="${PROJECT_ROOT}" name="ODE Test Problems.mltbx" optional="false">/Users/sandu/GIT/GitHub/ODE-Test-Problems/ODE Test Problems.mltbx</file> | ||
| </build-deliverables> | ||
| <workflow /> | ||
| <matlab> | ||
| <root>/Applications/MATLAB_R2024b.app</root> | ||
| <toolboxes> | ||
| <toolbox name="matlabcoder" /> | ||
| <toolbox name="embeddedcoder" /> | ||
| <toolbox name="fixedpoint" /> | ||
| <toolbox name="matlabhdlcoder" /> | ||
| <toolbox name="neuralnetwork" /> | ||
| </toolboxes> | ||
| <toolbox> | ||
| <matlabcoder> | ||
| <enabled>true</enabled> | ||
| </matlabcoder> | ||
| </toolbox> | ||
| <toolbox> | ||
| <embeddedcoder> | ||
| <enabled>true</enabled> | ||
| </embeddedcoder> | ||
| </toolbox> | ||
| <toolbox> | ||
| <fixedpoint> | ||
| <enabled>true</enabled> | ||
| </fixedpoint> | ||
| </toolbox> | ||
| <toolbox> | ||
| <matlabhdlcoder> | ||
| <enabled>true</enabled> | ||
| </matlabhdlcoder> | ||
| </toolbox> | ||
| <toolbox> | ||
| <neuralnetwork> | ||
| <enabled>true</enabled> | ||
| </neuralnetwork> | ||
| </toolbox> | ||
| </matlab> | ||
| <platform> | ||
| <unix>true</unix> | ||
| <mac>true</mac> | ||
| <windows>false</windows> | ||
| <win2k>false</win2k> | ||
| <winxp>false</winxp> | ||
| <vista>false</vista> | ||
| <linux>false</linux> | ||
| <solaris>false</solaris> | ||
| <osver>15.5</osver> | ||
| <os32>true</os32> | ||
| <os64>false</os64> | ||
| <arch>maci64</arch> | ||
| <matlab>true</matlab> | ||
| </platform> | ||
| </configuration> | ||
| </deployment-project> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Steven: We need to add these functions to the problem file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, here is an example
ODE-Test-Problems/toolbox/+otp/+brusselator/BrusselatorProblem.m
Lines 88 to 94 in 167bdc1