---------- Forwarded message ----------
From: Puelz, Charles Edward <cpu...@unc.edu>
Date: Sat, Aug 12, 2017 at 10:31 AM
Subject: libMesh queston
To: "jwpeter...@gmail.com" <jwpeter...@gmail.com>


Hi John,
> My name is Charles... I've got a quick question about implementing
> something in libMesh.  I'm solving a biharmonic equation using a mixed
> method approach, so I have a system of 2 variables.  How exactly do I pass
> in the exact solution and gradient for both variables, for error
> computation?
> I've looked at the documentation and I am a bit confused.  I see I need to
> create const std::vector<FunctionBase<Number> *> for the functions and
> const std::vector<FunctionBase<Number> *> for their gradients.
> Do you have an example by any chance?



You might want to have a look at examples/adaptivity/adaptivity_ex4. There
you can see several function prototypes, for example

Number exact_1D_solution(const Point & p,
>                          const Parameters &,  // parameters, not needed
>                          const std::string &, // sys_name, not needed
>                          const std::string &) // unk_name, not needed


In this example, there is only one variable in the system, so the 4th
parameter is not needed, but in your case, you would use that parameter to
determine which variable is currently being requested, i.e. in your
function you'd have logic like.

if (unk_name == "u")
  // return the exact solution for variable u
else if (unk_name == "v")
  // return the exact solution for variable u


By the way, be sure to send mail to libmesh-us...@lists.sf.net since 1) you
will get the fastest response and 2) you will help us create a searchable
archive of frequently asked questions for people to find in the future.

--
John
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to