<ParameterList name="MueLu">

  <!-- Configuration of the Xpetra operator (fine level) -->
  <ParameterList name="Matrix">
    <Parameter name="PDE equations"                         type="int" value="1"/> <!-- Number of PDE equations at each grid node.-->
  </ParameterList>

  <!-- Factory collection -->
  <ParameterList name="Factories">

    <!-- Note that ParameterLists must be defined prior to being used -->
      
    <ParameterList name="myCoalesceDropFact">
      <Parameter name="factory"                             type="string" value="CoalesceDropFactory"/>
      <Parameter name="lightweight wrap"                    type="bool"   value="true"/>
      <Parameter name="aggregation threshold"               type="double" value="0.0"/>
    </ParameterList>

    <ParameterList name="UncoupledAggregationFact">
      <Parameter name="factory"                             type="string" value="UncoupledAggregationFactory"/>
      <Parameter name="Graph"                               type="string" value="myCoalesceDropFact"/>
      <Parameter name="DofsPerNode"                         type="string" value="myCoalesceDropFact"/>
      <Parameter name="Ordering"                            type="string" value="Natural"/>
      <Parameter name="MaxNeighAlreadySelected"             type="int"    value="0"/>
      <Parameter name="MinNodesPerAggregate"                type="int"    value="4"/>
      <Parameter name="MaxNodesPerAggregate"                type="int"    value="9"/>
    </ParameterList>

    
    <ParameterList name="PA-AMG">
      <Parameter name="factory"                             type="string" value="TentativePFactory"/>
    </ParameterList>

    <ParameterList name="PG-AMG">
      <Parameter name="factory"                             type="string" value="PgPFactory"/>
      <Parameter name="P"                                   type="string" value="PA-AMG"/>
    </ParameterList>
  
    <ParameterList name="SA-AMG">
      <Parameter name="factory"                             type="string" value="SaPFactory"/>
      <Parameter name="P"                                   type="string" value="PA-AMG"/>
      <Parameter name="Damping factor"                      type="double" value="1.33"/>
    </ParameterList>
    
    <ParameterList name="myRestrictorFact">
      <Parameter name="factory"                             type="string" value="TransPFactory"/>
      <Parameter name="P"                                   type="string" value="PA-AMG"/>
    </ParameterList>

    <ParameterList name="myAggExportFact">
      <Parameter name="factory"                             type="string" value="AggregationExportFactory"/>
      <!--<Parameter name="DofsPerNode"                         type="string" value="myCoalesceDropFact"/>-->
	<Parameter name="Output filename"                   type="string" value="aggs_level%LEVELID_proc%PROCID.txt"/>
    </ParameterList>
    
    <ParameterList name="myRAPFact">
      <Parameter name="factory"                             type="string" value="RAPFactory"/>
      <Parameter name="P"                                   type="string" value="PA-AMG"/>
      <Parameter name="R"                                   type="string" value="myRestrictorFact"/>
      <ParameterList name="TransferFactories">
       <Parameter name="Visualization"                     type="string" value="myAggExportFact"/>
     </ParameterList>
    </ParameterList>
    
	<!-- =======================  REPARTITIONING  ======================= -->

	<!-- amalgamation of coarse level matrix -->
    <ParameterList name="myRebAmalgFact">
      <Parameter name="factory"                             type="string" value="AmalgamationFactory"/>
      <Parameter name="A"                                   type="string" value="myRAPFact"/>
    </ParameterList>

    <ParameterList name="myIsorropiaInterface">
      <Parameter name="factory"                             type="string" value="IsorropiaInterface"/>
      <Parameter name="A"                                   type="string" value="myRAPFact"/>
      <Parameter name="UnAmalgamationInfo"                  type="string" value="myRebAmalgFact"/>
    </ParameterList>

    <ParameterList name="myRepartitionInterface">
      <Parameter name="factory"                             type="string" value="RepartitionInterface"/>
      <Parameter name="A"                                   type="string" value="myRAPFact"/>
      <Parameter name="AmalgamatedPartition"                type="string" value="myIsorropiaInterface"/>
    </ParameterList>


    <ParameterList name="myRepartitionFact">
      <Parameter name="factory"                             type="string" value="RepartitionFactory"/>
      <Parameter name="A"                                   type="string" value="myRAPFact"/>
      <Parameter name="Partition"                           type="string" value="myRepartitionInterface"/>
      <Parameter name="minRowsPerProcessor"                 type="int"    value="800"/>
      <Parameter name="nonzeroImbalance"                    type="double" value="1.1"/>
      <Parameter name="startLevel"                          type="int"    value="1"/>
      <Parameter name="remapPartitions"                     type="bool"   value="false"/>
    </ParameterList>

    <ParameterList name="myRebalanceProlongatorFact">
      <Parameter name="factory"                             type="string" value="RebalanceTransferFactory"/>
      <Parameter name="type"                                type="string" value="Interpolation"/>
      <Parameter name="P"                                   type="string" value="PA-AMG"/>
    </ParameterList>

    <ParameterList name="myRebalanceRestrictionFact">
      <Parameter name="factory"                             type="string" value="RebalanceTransferFactory"/>
      <Parameter name="type"                                type="string" value="Restriction"/>
      <Parameter name="R"                                   type="string" value="myRestrictorFact"/>
      <Parameter name="Nullspace"                           type="string" value="PA-AMG"/>
    </ParameterList>

    <ParameterList name="myRebalanceAFact">
      <Parameter name="factory"                             type="string" value="RebalanceAcFactory"/>
      <Parameter name="A"                                   type="string" value="myRAPFact"/>
    </ParameterList>
    
    <!-- =======================  SMOOTHERS  ======================= -->

    <!-- not supported yet -->
    <ParameterList name="Chebyshev">
      <Parameter name="factory"                             type="string" value="TrilinosSmoother"/>
      <Parameter name="type"                                type="string" value="CHEBYSHEV"/>

      <ParameterList name="ParameterList">
        <Parameter name="chebyshev: degree"                 type="int"     value="3"/>>
        <!-- 7 in 2D, 20 in 3D -->
        <Parameter name="chebyshev: ratio eigenvalue"       type="double"  value="7"/>
        <Parameter name="chebyshev: min eigenvalue"         type="double"  value="1.0"/>
        <Parameter name="chebyshev: zero starting solution" type="bool"    value="true"/>
      </ParameterList>
    </ParameterList>

    <ParameterList name="Jacobi">
      <Parameter name="factory"                             type="string" value="TrilinosSmoother"/>
      <Parameter name="type"                                type="string" value="RELAXATION"/>
      <ParameterList name="ParameterList">
        <Parameter name="relaxation: type"                  type="string" value="Jacobi"/>
        <Parameter name="relaxation: sweeps"                type="int"    value="1"/>
        <Parameter name="relaxation: damping factor"        type="double" value="0.7"/>
      </ParameterList>
    </ParameterList>

    <ParameterList name="Gauss-Seidel">
      <Parameter name="factory"                             type="string" value="TrilinosSmoother"/>
      <Parameter name="type"                                type="string" value="RELAXATION"/>
      <ParameterList name="ParameterList">
        <Parameter name="relaxation: type"                  type="string" value="Gauss-Seidel"/>
        <Parameter name="relaxation: sweeps"                type="int"    value="1"/>
        <Parameter name="relaxation: damping factor"        type="double" value="0.7"/>
      </ParameterList>
    </ParameterList>

    
    <ParameterList name="Sym.Gauss-Seidel">
      <Parameter name="factory"                             type="string" value="TrilinosSmoother"/>
      <Parameter name="type"                                type="string" value="RELAXATION"/>
      <ParameterList name="ParameterList">
        <Parameter name="relaxation: type"                  type="string" value="Symmetric Gauss-Seidel"/>
        <Parameter name="relaxation: sweeps"                type="int"    value="1"/>
        <Parameter name="relaxation: damping factor"        type="double" value="0.7"/>
      </ParameterList>
    </ParameterList>

  </ParameterList>

  <!-- Definition of the multigrid preconditioner -->
  <ParameterList name="Hierarchy">

    <Parameter name="numDesiredLevel"                       type="int"      value="5"/> <!-- Max number of levels -->
    <Parameter name="maxCoarseSize"                         type="int"      value="1000"/> <!-- Min number of rows on coarsest level -->
    <Parameter name="verbosity"                             type="string"   value="High"/>

    <ParameterList name="AllLevel">
      <Parameter name="Smoother"                            type="string"   value="Jacobi"/>
      <Parameter name="Aggregates"                          type="string"   value="UncoupledAggregationFact"/>
      <Parameter name="Nullspace"                           type="string"   value="PA-AMG"/>
      <!--<Parameter name="Ptent"                               type="string"   value="PA-AMG"/>-->
      <Parameter name="P"                                   type="string"   value="PA-AMG"/>
      <Parameter name="R"                                   type="string"   value="myRestrictorFact"/>
      <Parameter name="A"                                   type="string"   value="myRAPFact"/>
      <Parameter name="CoarseSolver"                        type="string"   value="DirectSolver"/>
      <Parameter name="Importer"                            type="string"   value="myRepartitionFact"/>
      <Parameter name="Graph"                               type="string"   value="myCoalesceDropFact"/>
    </ParameterList>

  </ParameterList>
</ParameterList>
