Xikai,

You don't want to put the source code for your own shell matrix into the
libmesh source tree,
then recompile, install, etc.  You should be able to put all that in your
example directory and
compile it all there.  You might need to tweak the Makefile in your example
directory, but even
that probably isn't necessary.

Dmitry.

On Sun, Oct 18, 2015 at 10:33 AM Xikai Jiang <[email protected]> wrote:

> Thanks, Vikram. I'm referring to miscellaneous example 4 and now I
> understand.
>
> I created my own ShellMatrix:
>
> libmesh/include/numerics/user_shell_matrix.h
> libmesh/src/numerics/user_shell_matrix.C
>
> Then I reinstalled libmesh using configure, make, make install. After
> this, in my application code, I include
>
> #include "libmesh/user_shell_matrix.h"
>
> But when I compile my application code, I met an error:
>
> fatal error: libmesh/user_shell_matrix.h: No such file or directory
> compilation terminated.
>
> My config.log file is attached. Are there steps I missed?
>
> Xikai
>
> From: [email protected]
> Date: Fri, 16 Oct 2015 13:10:34 -0500
> Subject: Re: [Libmesh-users] Shell Matrix
> To: [email protected]
> CC: [email protected]
>
> On Fri, Oct 16, 2015 at 12:46 PM, Xikai Jiang <[email protected]> wrote:
> Dear libMesh developers and users,
>
>
>
> I want to use matrix-free method and am looking into ShellMatrix in
> libMesh. To get started, I've looked at the ShellMatrix example in example
> 4 under Miscellaneous folder, and got several questions:
>
>
>
> 1. In the example of ShellMatrix, why building the system stiffness
> matrix? If we use ShellMatrix, is there a need to explicitly build the
> system stiffness matrix? My understanding is, the system stiffness matrix
> in this example is used to demonstrate the SumShellMatrix, is it correct?
>
>
>
> If you are referring to miscellanous example 4, that example solves the
> equation- \Delta u + \int u = 1, and the total stiffness matrix is the sum
> of the rank-1 matrix induced by the \int u term and the sparse matrix
> induced by the \Delta u operator.
>
> 2. If I use only TensorShellMatrix, without SumShellMatrix, I still need
> to build RHS in the assemble function and attach it to the EquationSystem,
> is it correct?
>
>
>
> 3. In order to build any user-defined mac-vec multiplication, I think we
>
>  can create our own userShellMatrix.h and userShellMatrix.C, and define
>
> user-specific vector_mult(), vector_mult_add(), get_diagonal(), m() and
>
> n(), just as TensorShellMatrix and SumShellMatrix did. After this, we
>
> recompile libmesh, then we can start using userShellMatrix, and we don't
>
>  need to worry about implementing solving the linear system using
>
> MatShell in PETSc since it's already coded up in libMesh solver, is it
>
> correct?
>
>
>
> 4. The general procedure to use ShellMatrix in my mind is the following:
> (take userShellMatrix for example)
>
>
>
>        system.attach_assemble_function (assemble); // to build RHS
>
>        userShellMatrix<Number> shellMatrix(...); // define mat-vec
> multiplication
>
>        system.attach_shell_matrix(&shellMatrix);
>
>        system.solve();
>
>        system.detach_shell_matrix();
>
>
>
>     Is it correct?
>
>
>
>
>
> Regards, and thanks in advance for any answers.
>
>
>
> Xikai Jiang
>
> Postdoctoral Researcher
>
> Materials Science Division, Argonne National Laboratory
>
>
> ------------------------------------------------------------------------------
>
> _______________________________________________
>
> Libmesh-users mailing list
>
> [email protected]
>
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
>
>
> --
> Vikram GargPostdoctoral AssociatePredictive Engineering and Computational
> Science (PECOS)The University of Texas at Austinhttp://
> web.mit.edu/vikramvg/www/
>
> http://vikramvgarg.wordpress.com/
> http://www.runforindia.org/runners/vikramg
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Libmesh-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/libmesh-users
>
------------------------------------------------------------------------------
_______________________________________________
Libmesh-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libmesh-users

Reply via email to