Giter Club home page Giter Club logo

Comments (3)

j-signorelli avatar j-signorelli commented on June 3, 2024

Hi @karthichockalingam ,

You have to use a NonlinearForm with an appropriately-prepared NonlinearFormIntegrator for this - please check out #3975, I had pretty much this same question when first starting up with MFEM and hope that the linked discussion helps!

from mfem.

karthichockalingam avatar karthichockalingam commented on June 3, 2024

Thank you @j-signorelli for your response. I will have a look.

from mfem.

karthichockalingam avatar karthichockalingam commented on June 3, 2024

Hi @j-signorelli I was able to go over the issue and understand how to implement non-linear PDEs :)
Thanks a lot. Please let me know how I can make it a time-dependent problem.

$\frac{\partial u}{\partial t} -\nabla \cdot \kappa(u)\nabla u = f$

In the sample non-linear code gist, shared by @pazner , the AddDomainIntegrator is called using NonlinearForm

// 6. Set up the nonlinear form n(u,v) = (grad u, grad v) + (f(u), v)
   NonlinearForm n(&fespace);
   n.AddDomainIntegrator(new NonlinearMassIntegrator(fespace));
   n.AddDomainIntegrator(new DiffusionIntegrator);
   n.SetEssentialBC(boundary_dofs);

In the above code, I believe everything is assembled elementwise.

In ex16 were a time depenedent non-linear PDE is solved, the AddDomainIntegrator is called using BilinearForm

void ConductionOperator::SetParameters(const Vector &u)
{
   GridFunction u_alpha_gf(&fespace);
   u_alpha_gf.SetFromTrueDofs(u);
   for (int i = 0; i < u_alpha_gf.Size(); i++)
   {
      u_alpha_gf(i) = kappa + alpha*u_alpha_gf(i);
   }

   delete K;
   K = new BilinearForm(&fespace);

   GridFunctionCoefficient u_coeff(&u_alpha_gf);

   K->AddDomainIntegrator(new DiffusionIntegrator(u_coeff));
   K->Assemble();
   K->FormSystemMatrix(ess_tdof_list, Kmat);
   delete T;
   T = NULL; // re-compute T on the next ImplicitSolve
}

Maybe ex16, K is to setting up the global assembly of Kmat. I am not sure if I should proceed element-wise or by globally assembled matrix to make the problem time-dependent. If I should be using NonlinearForm or not.

If the sample non-linear code gist can be extended to time-dependent problems, it would be helpful.

Many thanks!!

from mfem.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.