HTML doc fixes.

This commit is contained in:
Salvatore Filippone
2017-07-25 14:13:43 +01:00
parent 1e00bb73f5
commit 79922b5939
34 changed files with 4163 additions and 3785 deletions
+138 -57
View File
@@ -7,8 +7,8 @@ original version by: Nikos Drakos, CBLU, University of Leeds
Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>License</TITLE>
<META NAME="description" CONTENT="License">
<TITLE>Adding new smoother and solver objects to MLD2P4</TITLE>
<META NAME="description" CONTENT="Adding new smoother and solver objects to MLD2P4">
<META NAME="keywords" CONTENT="userhtml">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
@@ -19,86 +19,167 @@ original version by: Nikos Drakos, CBLU, University of Leeds
<LINK REL="STYLESHEET" HREF="userhtml.css">
<LINK REL="next" HREF="node27.html">
<LINK REL="previous" HREF="node25.html">
<LINK REL="previous" HREF="node17.html">
<LINK REL="up" HREF="userhtml.html">
<LINK REL="next" HREF="node27.html">
</HEAD>
<BODY >
<!--Navigation Panel-->
<A NAME="tex2html393"
<A NAME="tex2html400"
HREF="node27.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html389"
<A NAME="tex2html396"
HREF="userhtml.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html383"
<A NAME="tex2html390"
HREF="node25.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html391"
<A NAME="tex2html398"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html394"
HREF="node27.html">Bibliography</A>
<B> Up:</B> <A NAME="tex2html390"
<B> Next:</B> <A NAME="tex2html401"
HREF="node27.html">Error Handling</A>
<B> Up:</B> <A NAME="tex2html397"
HREF="userhtml.html">userhtml</A>
<B> Previous:</B> <A NAME="tex2html384"
HREF="node25.html">Error Handling</A>
&nbsp; <B> <A NAME="tex2html392"
<B> Previous:</B> <A NAME="tex2html391"
HREF="node25.html">Subroutine descr</A>
&nbsp; <B> <A NAME="tex2html399"
HREF="node2.html">Contents</A></B>
<BR>
<BR>
<!--End of Navigation Panel-->
<H1><A NAME="SECTION000110000000000000000"></A><A NAME="sec:license"></A>
<H1><A NAME="SECTION00090000000000000000"></A><A NAME="sec:adding"></A>
<BR>
License
Adding new smoother and solver objects to MLD2P4
</H1><FONT SIZE="+1"><FONT SIZE="+1"></FONT></FONT>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">The MLD2P4 is freely distributable under the following copyright
terms: </FONT></FONT></FONT><PRE>
MLD2P4 version 2.1
MultiLevel Domain Decomposition Parallel Preconditioners Package
based on PSBLAS (Parallel Sparse BLAS version 3.4)
(C) Copyright 2008, 2010, 2012, 2017
Salvatore Filippone Cranfield University, Cranfield, UK
Ambra Abdullahi Hassan University of Rome Tor Vergata, Rome, IT
Alfredo Buttari CNRS-IRIT, Toulouse, FR
Pasqua D'Ambra IAC-CNR, Naples, IT
Daniela di Serafino University of Campania L. Vanvitelli, Caserta, IT
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions, and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of the MLD2P4 group or the names of its contributors may
not be used to endorse or promote products derived from this
software without specific written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE MLD2P4 GROUP OR ITS CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
</PRE><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">Developers can add completely new smoother and/or solver classes
derived from the base objects in the library (see Remark&nbsp;2 in Section&nbsp;<A HREF="node19.html#sec:precset">6.2</A>),
without recompiling the library itself.
</FONT></FONT></FONT>
<BR><HR>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">To do so, it is necessary first to select the base type to be extended.
In our experience, it is quite likely that the new application needs
only the definition of a ``solver'' object, which is almost
always acting only on the local part of the distributed matrix.
The parallel actions required to connect the various solver objects
are most often already provided by the block-Jacobi or the additive
Schwarz smoothers. To define a new solver, the developer will then
have to define its components and methods, perhaps taking one of the
predefined solvers as a starting point, if possible.
</FONT></FONT></FONT>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">Once the new smoother/solver class has been developed, to use it in
the context of the multilevel preconditioners it is necessary to:
</FONT></FONT></FONT>
<UL>
<LI>declare in the application program a variable of the new type;
</LI>
<LI>pass that variable as the argument to the <code>set</code> routine as in the
following:
<DIV ALIGN="CENTER">
<code>call p%set(smoother,info [,ilev,ilmax,pos])</code>
<BR><code>call p%set(solver,info [,ilev,ilmax,pos])</code>
</DIV>
</LI>
<LI>link the code implementing the various methods into the application executable.
</LI>
</UL><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
The new solver object is then dynamically included in the
preconditioner structure, and acts as a <I>mold</I> to which the
preconditioner will conform, even though the MLD2P4 library has not
been modified to account for this new development.
</FONT></FONT></FONT>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">It is possible to define new values for the keyword <code>WHAT</code> in the
<code>set</code> routine; if the library code does not recognize a keyword,
it passes it down the composition hierarchy (levels containing
smoothers containing in turn solvers), so that it can be eventually caught by
the new solver.
</FONT></FONT></FONT>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">An example is provided in the source code distribution under the
folder <code>tests/newslv</code>. In this example we are implementing a new
incomplete factorization variant (which is simply the ILU(0)
factorization under a new name). Because of the specifics of this case, it is
possible to reuse the basic structure of the ILU solver, with its
L/D/U components and the methods needed to apply the solver; only a
few methods, such as the description and most importantly the build,
need to be ovverridden (rewritten).
</FONT></FONT></FONT>
<P>
<FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">The interfaces for the calls shown above are defined using
</FONT></FONT></FONT>
<DIV ALIGN="CENTER"><FONT SIZE="+1"><FONT SIZE="+1"></FONT></FONT><TABLE CELLPADDING=3>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
<code>smoother</code> </FONT></FONT></FONT></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1"> <code>class(mld_x_base_smoother_type)</code> </FONT></FONT></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
</FONT></FONT></FONT></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1"> The user-defined new smoother to be employed in the
preconditioner.</FONT></FONT></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
<code>solver</code> </FONT></FONT></FONT></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1"> <code>class(mld_x_base_solver_type)</code> </FONT></FONT></FONT></TD>
</TR>
<TR><TD ALIGN="LEFT" VALIGN="TOP" WIDTH=40><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
</FONT></FONT></FONT></TD>
<TD ALIGN="LEFT" VALIGN="TOP" WIDTH=340><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1"> The user-defined new solver to be employed in the
preconditioner.
</FONT></FONT></FONT></TD>
</TR>
</TABLE><FONT SIZE="+1"><FONT SIZE="+1"></FONT></FONT></DIV><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
The other arguments are defined in the way described in
Sec.&nbsp;<A HREF="node19.html#sec:precset">6.2</A>. As an example, in the <code>tests/newslv</code>
code we define a new object of type <code>mld_d_tlu_solver_type</code>, and
we pass it as follows:
</FONT></FONT></FONT><PRE>
! sparse matrix and preconditioner
type(psb_dspmat_type) :: a
type(mld_dprec_type) :: prec
type(mld_d_tlu_solver_type) :: tlusv
......
!
! prepare the preconditioner: an ML with defaults, but with TLU solver at
! intermediate levels. All other parameters are at default values.
!
call prec%init('ML', info)
call prec%hierarchy_build(a,desc_a,info)
nlv = prec%get_nlevs()
call prec%set(tlusv, info,ilev=1,ilmax=max(1,nlv-1))
call prec%smoothers_build(a,desc_a,info)
</PRE><FONT SIZE="+1"><FONT SIZE="+1"><FONT SIZE="+1">
</FONT></FONT></FONT><HR>
<!--Navigation Panel-->
<A NAME="tex2html400"
HREF="node27.html">
<IMG WIDTH="37" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="next" SRC="next.png"></A>
<A NAME="tex2html396"
HREF="userhtml.html">
<IMG WIDTH="26" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="up" SRC="up.png"></A>
<A NAME="tex2html390"
HREF="node25.html">
<IMG WIDTH="63" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="previous" SRC="prev.png"></A>
<A NAME="tex2html398"
HREF="node2.html">
<IMG WIDTH="65" HEIGHT="24" ALIGN="BOTTOM" BORDER="0" ALT="contents" SRC="contents.png"></A>
<BR>
<B> Next:</B> <A NAME="tex2html401"
HREF="node27.html">Error Handling</A>
<B> Up:</B> <A NAME="tex2html397"
HREF="userhtml.html">userhtml</A>
<B> Previous:</B> <A NAME="tex2html391"
HREF="node25.html">Subroutine descr</A>
&nbsp; <B> <A NAME="tex2html399"
HREF="node2.html">Contents</A></B>
<!--End of Navigation Panel-->
</BODY>
</HTML>