Page MenuHomec4science

equilibrium_stagger.hpp
No OneTemporary

File Metadata

Created
Sat, Jul 27, 18:16

equilibrium_stagger.hpp

/* =============================================================================
Copyright (c) 2014-2017 F. Georget <fabieng@princeton.edu> Princeton University
Copyright (c) 2017 F. Georget <fabien.georget@epfl.ch> EPFL
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. *
============================================================================= */
#ifndef REACTMICP_CHLORIDE_EQUILIBRIUMSTAGGER_HPP
#define REACTMICP_CHLORIDE_EQUILIBRIUMSTAGGER_HPP
#include "chem_stagger_base.hpp"
#include "specmicp_common/pimpl_ptr.hpp"
#include <vector>
namespace specmicp {
struct AdimensionalSystemSolution;
struct AdimensionalSystemConstraints;
struct AdimensionalSystemSolverOptions;
namespace micpsolver {
enum class MiCPSolverReturnCode;
} // namespace micpsolver
namespace reactmicp {
namespace systems {
class EquilibriumOptionsVector;
namespace chloride {
class BoundaryConditions;
class SPECMICP_DLL_PUBLIC ChlorideEquilibriumStagger:
public ChlorideChemistryStaggerBase
{
public:
using VariablesBase = solver::VariablesBase;
using StaggerReturnCode = solver::StaggerReturnCode;
ChlorideEquilibriumStagger(
std::shared_ptr<ChlorideVariables> var,
std::shared_ptr<BoundaryConditions> bcs,
std::shared_ptr<EquilibriumOptionsVector> opts
);
~ChlorideEquilibriumStagger();
//! \brief Initialize the stagger at the beginning of the computation
//!
//! \param var a raw pointer to the variables
void initialize(VariablesBase * const var) override;
//! \brief Initialize the stagger at the beginning of an iteration
//!
//! This is where the predictor can be saved, the first trivial iteration done, ...
//!
//! \param dt the duration of the timestep
//! \param var a raw pointer to the variables
void initialize_timestep(scalar_t dt, VariablesBase * const var) override;
//! \brief Solve the equation for the timestep
//!
//! \param var a raw ptr to the variables
solver::StaggerReturnCode restart_timestep(VariablesBase * const var) override;
//! \brief Return the solution for one node // when given displacements
virtual ReturnCode solve_equilibrium_at_node(
index_t node,
VariablesBase* const var,
AdimensionalSystemSolution& out) override;
//! \brief Return the solution for one node // when given displacements
virtual ReturnCode solve_equilibrium_at_node(
index_t node,
ChlorideVariables * const var,
AdimensionalSystemSolution& out) override;
//! \brief Return the solution for one node
virtual ReturnCode solve_equilibrium_at_node(
index_t element,
index_t enode,
ChlorideVariables * const var,
const Eigen::Ref<const Vector>& element_displacement,
AdimensionalSystemSolution& out) override;
//! \brief Return the solution for one node
virtual ReturnCode solve_equilibrium_at_node(
index_t node,
ChlorideVariables * const var,
const Eigen::Ref<const Vector>& nodal_displacement,
AdimensionalSystemSolution& out) override;
// Options
//! \brief Clear preset options, and set new default options
void clear_options(const AdimensionalSystemSolverOptions& options);
void set_options(index_t node, const AdimensionalSystemSolverOptions& options);
void set_options(const std::vector<index_t>& nodes, const AdimensionalSystemSolverOptions& options);
// Constraints
//! \brief Clear preset constraints, and set new default constraints
//void clear_constraints(const AdimensionalSystemConstraints& constraints);
//void set_constraints(index_t node, const AdimensionalSystemConstraints& constraints);
//void set_constraints(const std::vector<index_t>& nodes, const AdimensionalSystemConstraints& constraints);
private:
struct ChlorideEquilibriumStaggerImpl;
utils::pimpl_ptr<ChlorideEquilibriumStaggerImpl> m_impl;
};
} // namespace chloride
} // namespace systems
} // namespace reactmicp
} // namespace specmicp
#endif // REACTMICP_CHLORIDE_EQUILIBRIUMSTAGGER_HPP

Event Timeline