Page MenuHomec4science

solver_callback.hh
No OneTemporary

File Metadata

Created
Tue, Nov 19, 10:56

solver_callback.hh

/**
* @file solver_callback.hh
*
* @author Nicolas Richart <nicolas.richart@epfl.ch>
*
* @date Tue Sep 15 22:45:27 2015
*
* @brief Class defining the interface for non_linear_solver callbacks
*
* @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 "aka_common.hh"
/* -------------------------------------------------------------------------- */
#ifndef __AKANTU_SOLVER_CALLBACK_HH__
#define __AKANTU_SOLVER_CALLBACK_HH__
namespace akantu {
class DOFManager;
}
namespace akantu {
class SolverCallback {
/* ------------------------------------------------------------------------ */
/* Constructors/Destructors */
/* ------------------------------------------------------------------------ */
public:
explicit SolverCallback(DOFManager & dof_manager);
explicit SolverCallback();
/* ------------------------------------------------------------------------ */
virtual ~SolverCallback();
protected:
void setDOFManager(DOFManager & dof_manager);
/* ------------------------------------------------------------------------ */
/* Methods */
/* ------------------------------------------------------------------------ */
public:
/// get the type of matrix needed
virtual MatrixType getMatrixType(const ID &) = 0;
/// callback to assemble a Matrix
virtual void assembleMatrix(const ID &) = 0;
/// callback to assemble a lumped Matrix
virtual void assembleLumpedMatrix(const ID &) = 0;
/// callback to assemble the residual (rhs)
virtual void assembleResidual() = 0;
/* ------------------------------------------------------------------------ */
/* Dynamic simulations part */
/* ------------------------------------------------------------------------ */
/// callback for the predictor (in case of dynamic simulation)
virtual void predictor() { }
/// callback for the corrector (in case of dynamic simulation)
virtual void corrector() { }
/* ------------------------------------------------------------------------ */
/* management callbacks */
/* ------------------------------------------------------------------------ */
virtual void beforeSolveStep() { };
virtual void afterSolveStep() { };
protected:
/// DOFManager prefixed to avoid collision in multiple inheritance cases
DOFManager * sc_dof_manager{nullptr};
};
} // namespace akantu
#endif /* __AKANTU_SOLVER_CALLBACK_HH__ */

Event Timeline