Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F80958682
non_linear_solver_petsc.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Tue, Sep 3, 11:28
Size
3 KB
Mime Type
text/x-c++
Expires
Thu, Sep 5, 11:28 (1 d, 22 h)
Engine
blob
Format
Raw Data
Handle
20484563
Attached To
rAKA akantu
non_linear_solver_petsc.hh
View Options
/**
* @file non_linear_solver_petsc.hh
*
* @author Nicolas Richart
*
* @date creation Tue Jan 01 2019
*
* @brief A Documented file.
*
* @section LICENSE
*
* Copyright (©) 2010-2011 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
* Akantu is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free
* Software Foundation, either version 3 of the License, or (at your option) any
* later version.
*
* Akantu is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
* A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with Akantu. If not, see <http://www.gnu.org/licenses/>.
*
*/
/* -------------------------------------------------------------------------- */
#include "non_linear_solver.hh"
/* -------------------------------------------------------------------------- */
#include <petscsnes.h>
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_NON_LINEAR_SOLVER_PETSC_HH__
#define __AKANTU_NON_LINEAR_SOLVER_PETSC_HH__
namespace akantu {
class DOFManagerPETSc;
class NonLinearSolverPETScCallback;
class SolverVectorPETSc;
} // namespace akanatu
namespace akantu {
class NonLinearSolverPETSc : public NonLinearSolver {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
NonLinearSolverPETSc(DOFManagerPETSc & dof_manager,
const NonLinearSolverType & non_linear_solver_type,
const ID & id = "non_linear_solver_petsc",
UInt memory_id = 0);
~NonLinearSolverPETSc() override;
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
/// solve the system described by the jacobian matrix, and rhs contained in
/// the dof manager
void solve(SolverCallback & callback) override;
/// parse the arguments from the input file
void parseSection(const ParserSection & section) override;
/* ------------------------------------------------------------------------ */
/* Class Members */
/* ------------------------------------------------------------------------ */
protected:
static PetscErrorCode FormFunction(SNES snes, Vec dx, Vec f,
void * ctx);
static PetscErrorCode FormJacobian(SNES snes, Vec dx, Mat J,
Mat P, void * ctx);
void set_param(const ID & param, const std::string & value) override;
DOFManagerPETSc & dof_manager;
/// PETSc non linear solver
SNES snes;
SolverCallback * callback{nullptr};
std::unique_ptr<SolverVectorPETSc> x;
std::unique_ptr<NonLinearSolverPETScCallback> ctx;
Int n_iter{0};
};
} // namepsace akantu
#endif /* __AKANTU_NON_LINEAR_SOLVER_PETSC_HH__ */
Event Timeline
Log In to Comment