On Mon, 2 Nov 2015, avidday wrote:

> Is there an easy way to apply initial conditions selectively on different
> sub-domains within a mesh?
>
> I have typically used ProjectSolution() to apply initial conditions using a
> function, but I am working on a simulation at the moment where the gmsh
> generated mesh comes with pre-defined sub-domains, and it would be
> convenient to use those directly to selectively apply initial conditions to
> the system. I had a look at the example which uses restrict_solve_to() to
> limit the solver to a given subdomain, but I haven't been able to get
> ProjectSolution() to honour and sub domains restrictions I apply. It might
> be that I don't have the correct sequence of operations to make this work,
> but if someone can tell me if it is possible, it would be a huge help

I don't recall any project_vector option that checks subdomain ids,
but it'd be easy enough to do so inside the functor or function you
provide.  Use the FEMFunctionBase interface, and then inside your
operator(context, index, point, time) override, test
context.elem->subdomain_id().

I wanted to point you to some example code, but the first place I
checked had:
   std::cerr << "Error: GRINS does not yet support per-subdomain initial 
conditions" << std::endl;

which is less helpful than I had hoped.  ;-)
---
Roy

------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
Libmesh-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to