Exemple #1
0
 /*!
   @param list A Parameter list to be filled
   @param dataFile A GetPot object containing the data about the preconditioner
   @param section The section in "dataFile" where to find data about the preconditioner
   @param subSection The subsection in "dataFile" where to find data about the preconditioner
  */
 virtual void createParametersList ( list_Type& list,
                                     const GetPot& dataFile,
                                     const std::string& section,
                                     const std::string& subSection )
 {
     createMLList ( list, dataFile, section, subSection, M_comm->MyPID() == 0 );
 }
// ===================================================
// Set Methods
// ===================================================
void
PreconditionerML::setDataFromGetPot ( const GetPot&      dataFile,
                                      const std::string& section )
{
    bool verbose = M_comm->MyPID() == 0;

    M_analyze = dataFile ( (section + "/" + "ML" + "/analyze_smoother" ).data(), false); // To be moved in createMLList

    // ML List
    createMLList ( M_list, dataFile, section, "ML", verbose );

    // visualization
    bool found (false);
    bool enableViz    = dataFile ( (section + "/" + "ML" + "/visualization/enable").data(), false, found );
    if ( found )
    {
        /*
           If the visualization is desired and we have set the required data,
           we set the following variables.
           (see Trilinos::ML manual for more details)
         */
        if (M_visualizationDataAvailable)
        {
            M_list.set ( "viz: enable", enableViz);
            M_list.set ( "viz: output format", "vtk");
            M_list.set ("x-coordinates", & ( (*M_xCoord) [0]) );
            M_list.set ("y-coordinates", & ( (*M_yCoord) [0]) );
            M_list.set ("z-coordinates", & ( (*M_zCoord) [0]) );
        }
        else
        {
            std::cout << "Warning: Visualization options are not available if you have not use setVerticesCoordinates first!" << std::endl;
        }
    }

    // IfPack list
    bool MLPrintParameterList = dataFile ( (section + "/displayList").data(), false );
    if ( MLPrintParameterList && verbose )
    {
        std::cout << "Smoother: ";
    }
    list_Type& SmootherIFSubList = M_list.sublist ( "smoother: ifpack list" );
    PreconditionerIfpack::createIfpackList ( SmootherIFSubList, dataFile, section, "ML", verbose );
}