Page MenuHomec4science

boundary_conditions.hpp
No OneTemporary

File Metadata

Created
Sat, Jun 8, 10:27

boundary_conditions.hpp

/* =============================================================================
Copyright (c) 2014 - 2016
F. Georget <fabieng@princeton.edu> Princeton University
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 SPECMICP_REACTMICP_UNSATURATED_BOUNDARYCONDITIONS_HPP
#define SPECMICP_REACTMICP_UNSATURATED_BOUNDARYCONDITIONS_HPP
//! \file unsaturated/boundary_conditions.hpp
//! \brief Boundary conditions for the unsaturated systems
#include "types.hpp"
#include "utils/pimpl_ptr.hpp"
#include <memory>
#include <vector>
namespace specmicp {
struct AdimensionalSystemConstraints;
namespace reactmicp {
namespace systems {
namespace unsaturated {
//! \brief Boundary conditions for the unsaturated system
//!
//! Contains both the transport and chemistry boundary conditions
class SPECMICP_DLL_PUBLIC BoundaryConditions
{
public:
//! \brief Return a pointer to a new set of boundary conditions
static std::shared_ptr<BoundaryConditions> make(uindex_t nb_nodes) {
return std::make_shared<BoundaryConditions>(nb_nodes);
}
//! \brief Build a BC container for the given number of node
//!
//! \sa make
BoundaryConditions(uindex_t nb_nodes);
~BoundaryConditions();
//! \brief Set the given node to be a gas node (S_l=0)
void add_gas_node(uindex_t node);
//! \brief Set the given node to be of fixed composition
void add_fixed_node(uindex_t node);
//! \brief Return true if the node is a gas node
bool is_gas_node(uindex_t node) const;
//! \brief Return true if the node has a fixed composition
bool is_fixed_node(uindex_t node) const;
//! \brief Return true if the node is neither a gas nor a fixed node
bool is_normal_node(uindex_t node) const;
//! \brief Return the chemical constraint of the given node
const AdimensionalSystemConstraints& get_constraint(uindex_t node) const;
//! \brief Return the chemical constraint of the given node
//!
//! \warning Changing the constraint changes it for all node sharing the
//! same constraint. To modify only this node, use `fork_constraints' first.
//!
AdimensionalSystemConstraints& get_constraint(uindex_t node);
//! \brief Return the constraint identified by 'name'
const AdimensionalSystemConstraints& get_constraint(
const std::string& name) const;
//! \brief Return the constraint identified by 'name'
AdimensionalSystemConstraints& get_constraint(const std::string& name);
//! \brief Set a new constraints for the given node
AdimensionalSystemConstraints& fork_constraints(
uindex_t node,
const std::string& name
);
//! \brief Set the constraint of the given node
void set_constraint(uindex_t node, const std::string& name);
//! \brief Return the vector of gas nodes
std::vector<index_t> get_gas_nodes();
//! \brief Return the vector of fixed nodes
std::vector<index_t> get_fixed_nodes();
private:
struct SPECMICP_DLL_LOCAL BoundaryConditionsImpl;
utils::pimpl_ptr<BoundaryConditionsImpl> m_impl;
BoundaryConditions(const BoundaryConditions& other) = delete;
BoundaryConditions& operator=(const BoundaryConditions& other) = delete;
};
} //end namespace unsaturated
} //end namespace systems
} //end namespace reactmicp
} //end namespace specmicp
#endif // SPECMICP_REACTMICP_UNSATURATED_BOUNDARYCONDITIONS_HPP

Event Timeline