I rewrote example 15 for a MPI-environment using Trilinos, and solve it with
IndexSet solution_relevant_partitioning(dof_handler.n_dofs());
        DoFTools::extract_locally_relevant_dofs(dof_handler, 
solution_relevant_partitioning);
        LinearAlgebraTrilinos::MPI::Vector completely_distributed_solution(
dof_handler.locally_owned_dofs(), mpi_communicator);
        LinearAlgebraTrilinos::MPI::Vector completely_distributed_update(
dof_handler.locally_owned_dofs(), mpi_communicator);

        completely_distributed_solution = present_solution;

        SolverControl solver_control (dof_handler.n_dofs(),
                                      (system_rhs.l2_norm() > 0) ? 1e-6 * 
system_rhs.l2_norm() : 1e-6);
        LinearAlgebraTrilinos::SolverGMRES  solver (solver_control);

        LinearAlgebraTrilinos::MPI::PreconditionAMG preconditioner;
        LinearAlgebraTrilinos::MPI::PreconditionAMG::AdditionalData data;

        print_status_update("Initializing system matrix with 
preconditioner\n");
        preconditioner.initialize(system_matrix, data);
        print_status_update("Solving\n");
        solver.solve (system_matrix, completely_distributed_update, 
system_rhs,
                      preconditioner);
        print_status_update("Solving done\n");

        hanging_node_constraints.distribute (completely_distributed_update);


        print_status_update("Adding to newton\n");
        newton_update = completely_distributed_update;

        newton_update.compress(VectorOperation::insert);

        const double alpha = determine_step_length();
        completely_distributed_solution.add (alpha, 
completely_distributed_update);

        present_solution = completely_distributed_solution;

which works fine. Now, as next step I wanted to test if I could introduce 
an offset, i.e. the resulting surface is not located at z=0, but rather at 
z=OFFSET, with OFFSET a double value set at the beginning. Thus I also 
initialize the solution accordingly with
    template <int dim>
    class InitialValues : public Function<dim>
    {
        public:
            InitialValues () : Function<dim>() {}
            virtual double value(const Point<dim> &p, const unsigned int 
component) const;
    };

    template <int dim>
    double InitialValues<dim>::value(const Point<dim> &p, const unsigned int 
component) const
    {
        return OFFSET;
    }                

//In run-function
                LinearAlgebraTrilinos::MPI::Vector local_solution;
                local_solution.reinit(dof_handler.locally_owned_dofs(), 
mpi_communicator);
                VectorTools::project (dof_handler,
                                      boundary_constraints,
                                      QGauss<dim>(fe.degree+2),
                                      InitialValues<dim>(),
                                      local_solution);
                //boundary_constraints.distribute(local_solution);
                present_solution = local_solution;

Now I notice that if my offset goes above a certain level, I have to reduce 
the step length, else I get the error
An error occurred in line <522> of file </home/roland/Downloads/dealii/
source/lac/trilinos_solver.cc> in function
    void dealii::TrilinosWrappers::SolverBase::do_solve(const Preconditioner
&) [with Preconditioner = dealii::TrilinosWrappers::PreconditionBase]
The violated condition was: 
    false
Additional information: 
    AztecOO::Iterate error code -3: loss of precision

I do not understand the reason why that happens. Is it a mathematical 
problem? Or rather a problem in my code? Afaik the gradients should not 
depend on the offset, thus I do not know where to look for the problem here.
Thanks!

-- 
The deal.II project is located at http://www.dealii.org/
For mailing list/forum options, see 
https://groups.google.com/d/forum/dealii?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"deal.II User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to dealii+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to