Thanks a lot for your help.

It looks like point_value uses "current_local_solution" rather than
"solution," so initially every function returned zero. But once I changed
"solution->set()" to "current_local_solution->set()" everything seems to
work fine. I'm not really sure what the difference is, so I'm hoping that
is a reasonable thing to do.


> How would I set the type of the
>> vector, for example a vector?
>
>
> Not sure what this question is asking...
>

I was wondering how I should deal with vector-valued variables? Should I
just allocate a new variable for every component of the vector, or would it
be better to handle this in another way?



> System::point_value() is not deprecated as far as I know, and even if it
> was, it should not produce an error message unless you are also using it
> incorrectly. What did you try to call, exactly?
>

The warning that I receive is:

*** Warning, This code is deprecated, and likely to be removed in future
library versions! ./include/libmesh/mesh_tools.h, line 70, compiled Aug 19
2017 at 14:03:27 ***

>From what I can tell point_value() isn't marked deprecated, but it invokes
a deprecated form of the BoundaryBox constructor. I suppose I'll just
ignore it.


Thanks again for your help.

Regards,
   Jim



On Tue, Aug 22, 2017 at 8:38 AM, John Peterson <jwpeter...@gmail.com> wrote:

>
>
> On Sat, Aug 19, 2017 at 6:15 PM, James Strother <
> james.a.strot...@gmail.com> wrote:
>
>> Hello,
>>
>> I'm working on a program where I would like to find values and gradients
>> for variables that are specified on a mesh. I was hoping to do this using
>> libmesh. I've gone through the documentation but it is a lot to take in. I
>> would really appreciate it if someone could point me in the right
>> direction.
>>
>> Here is a quick test case I put together:
>>
>> ----
>>
>>    /* create mesh */
>>    libMesh::Mesh mesh(init.comm());
>>
>>    mesh.set_spatial_dimension(2);
>>
>>    libMesh::Node* n0 = new libMesh::Node(0, 0);
>>    libMesh::Node* n1 = new libMesh::Node(1, 0);
>>    libMesh::Node* n2 = new libMesh::Node(0, 1);
>>
>>    mesh.add_node(n0);
>>    mesh.add_node(n1);
>>    mesh.add_node(n2);
>>
>>    libMesh::Tri3* e1 = new libMesh::Tri3();
>>    e1->set_node(0) = n0;
>>    e1->set_node(1) = n1;
>>    e1->set_node(2) = n2;
>>
>>    mesh.add_elem(e1);
>>
>>    mesh.prepare_for_use();
>>
>>    /* create system */
>>    libMesh::EquationSystems eq_sys(mesh);
>>
>>    libMesh::ExplicitSystem& sys =
>> eq_sys.add_system<libMesh::ExplicitSystem>("Interp System");
>>
>>    sys.add_variable("u", libMesh::FIRST, libMesh::LAGRANGE);
>>
>> ----
>>
>> But I couldn't figure out what to do next.
>
>
> You need to call eq_sys.init() once you are done adding variables.
>
>
>
>> How would I set the type of the
>> vector, for example a vector?
>
>
> Not sure what this question is asking...
>
>
>> How do I assign values to the variable?
>
>
> In this simple example, you can assign values directly to the solution
> vector if you want.
>
> sys.solution->set(/*dof=*/0, /*value=*/10.);
>
>
>> How
>> do I evaluate the variables at specific points? I saw the "point_value"
>> function in the System class, but when I use that I receive an error that
>> it is deprecated. What should I do instead?
>>
>
> System::point_value() is not deprecated as far as I know, and even if it
> was, it should not produce an error message unless you are also using it
> incorrectly. What did you try to call, exactly?
>
> --
> John
>



-- 
James Strother, Ph.D.
Assistant Professor
Dept. of Integrative Biology
Oregon State University
------------------------------------------------------------------------------
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