diff --git a/src/reactmicp/CMakeLists.txt b/src/reactmicp/CMakeLists.txt index 39d0146..3b9ef35 100644 --- a/src/reactmicp/CMakeLists.txt +++ b/src/reactmicp/CMakeLists.txt @@ -1,191 +1,206 @@ # ReactMiCP # ============= set(REACTMICP_SOLVER_DIR solver) set(REACTMICP_SYSTEMS_DIR systems) set(REACTMICP_EQUILIBRIUMCURVE equilibrium_curve) set(REACTMICP_IO io) +set(REACTMICP_UNSAT_DIR ${REACTMICP_SYSTEMS_DIR}/unsaturated) + add_custom_target(reactmicp_incl SOURCES ${REACTMICP_SOLVER_DIR}/reactive_transport_solver_structs.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/variables_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/transport_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/chemistry_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/upscaling_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/stagger_structs.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/decl.inl ${REACTMICP_SOLVER_DIR}/staggers_base/staggers_base.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/variablesfwd.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/types_fwd.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/variables_sub.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/variables_box.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/transport_constraints.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/fv_1dof_equation.hpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/fv_1dof_equation.inl + ${REACTMICP_UNSAT_DIR}/types_fwd.hpp + ${REACTMICP_UNSAT_DIR}/variables_sub.hpp + ${REACTMICP_UNSAT_DIR}/variables_box.hpp + ${REACTMICP_UNSAT_DIR}/transport_constraints.hpp + ${REACTMICP_UNSAT_DIR}/fv_1dof_equation.hpp + ${REACTMICP_UNSAT_DIR}/fv_1dof_equation.inl + ${REACTMICP_UNSAT_DIR}/init_variables.hpp ) set(REACTMICP_LIBFILES ${REACTMICP_EQUILIBRIUMCURVE}/chemistry.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_extractor.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_coupler.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_solid_transport.cpp # Flexible reactive transport solver # ---------------------------------- ${REACTMICP_SOLVER_DIR}/reactive_transport_solver.cpp ${REACTMICP_SOLVER_DIR}/timestepper.cpp ${REACTMICP_SOLVER_DIR}/runner.cpp # ${REACTMICP_SYSTEMS_DIR}/saturated_react/variables.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/transport_program.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/transport_stagger.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/equilibrium_stagger.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/kinetic_stagger.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/react_solver.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/init_variables.cpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/diffusive_upscaling_stagger.cpp - - ${REACTMICP_SYSTEMS_DIR}/unsaturated/variables.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/saturation_equation.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/saturation_pressure_equation.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/pressure_equation.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/aqueous_equation.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/aqueous_pressure_equation.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/transport_stagger.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/equilibrium_stagger.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/variables_interface.cpp - ${REACTMICP_SYSTEMS_DIR}/unsaturated/equilibrium_constraints.cpp + ${REACTMICP_UNSAT_DIR}/variables.cpp + ${REACTMICP_UNSAT_DIR}/saturation_equation.cpp + ${REACTMICP_UNSAT_DIR}/saturation_pressure_equation.cpp + ${REACTMICP_UNSAT_DIR}/pressure_equation.cpp + ${REACTMICP_UNSAT_DIR}/aqueous_equation.cpp + ${REACTMICP_UNSAT_DIR}/aqueous_pressure_equation.cpp + ${REACTMICP_UNSAT_DIR}/transport_stagger.cpp + ${REACTMICP_UNSAT_DIR}/equilibrium_stagger.cpp + ${REACTMICP_UNSAT_DIR}/variables_interface.cpp + ${REACTMICP_UNSAT_DIR}/equilibrium_constraints.cpp ${REACTMICP_IO}/reactive_transport.cpp ${REACTMICP_IO}/saturated_react.cpp ${REACTMICP_IO}/configuration.cpp ) # hdf5 # ----- if (HDF5_FOUND) list(APPEND REACTMICP_LIBFILES ${REACTMICP_IO}/hdf5_unsaturated.cpp) include_directories(${HDF5_INCLUDE_DIRS}) set_source_files_properties( ${REACTMICP_IO}/hdf5_unsaturated.cpp PROPERTIES COMPILE_DEFINITIONS HDF5_DEFINITIONS ) endif() set_visibility_flag(${REACTMICP_LIBFILES}) set_pgo_flag(${REACTMICP_LIBFILES}) if(OPENMP_FOUND) if(SPECMICP_USE_OPENMP) set_source_files_properties(${REACTMICP_SYSTEMS_DIR}/saturated_react/equilibrium_stagger.cpp PROPERTIES COMPILE_DEFINITIONS "SPECMICP_USE_OPENMP" ) set_source_files_properties(${REACTMICP_SYSTEMS_DIR}/saturated_react/kinetic_stagger.cpp PROPERTIES COMPILE_DEFINITIONS "SPECMICP_USE_OPENMP" ) set_source_files_properties(${REACTMICP_SYSTEMS_DIR}/unsaturated/transport_stagger.cpp PROPERTIES COMPILE_DEFINITIONS "SPECMICP_USE_OPENMP" ) set_source_files_properties(${REACTMICP_SYSTEMS_DIR}/unsaturated/equilibrium_stagger.cpp PROPERTIES COMPILE_DEFINITIONS "SPECMICP_USE_OPENMP" ) endif() endif() add_library(objreactmicp OBJECT ${REACTMICP_LIBFILES}) set_property(TARGET objreactmicp PROPERTY POSITION_INDEPENDENT_CODE 1) add_library(reactmicp SHARED $) target_link_libraries(reactmicp dfpm) install(TARGETS reactmicp LIBRARY DESTINATION ${LIBRARY_INSTALL_DIR} ) # include files # ------------- set(REACTMICP_STAGGERBASE_INCLUDE_LIST ${REACTMICP_SOLVER_DIR}/staggers_base/variables_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/transport_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/chemistry_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/upscaling_stagger_base.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/stagger_structs.hpp ${REACTMICP_SOLVER_DIR}/staggers_base/decl.inl ${REACTMICP_SOLVER_DIR}/staggers_base/staggers_base.hpp ) set(REACTMICP_SOLVER_INCLUDE_LIST ${REACTMICP_SOLVER_DIR}/reactive_transport_solver_structs.hpp ${REACTMICP_SOLVER_DIR}/reactive_transport_solver.hpp ${REACTMICP_SOLVER_DIR}/timestepper.hpp ${REACTMICP_SOLVER_DIR}/runner.hpp ) set(REACTMICP_SATURATEDREACT_INCLUDE_LIST ${REACTMICP_SYSTEMS_DIR}/saturated_react/variablesfwd.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/variables.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/transport_program.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/transport_stagger.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/equilibrium_stagger.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/kinetic_stagger.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/react_solver.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/init_variables.hpp ${REACTMICP_SYSTEMS_DIR}/saturated_react/diffusive_upscaling_stagger.hpp ) +set(REACTMICP_UNSATUREATED_INCLUDE_LIST + ${REACTMICP_UNSAT_DIR}/types_fwd.hpp + ${REACTMICP_UNSAT_DIR}/variables_sub.hpp + ${REACTMICP_UNSAT_DIR}/variables_box.hpp + ${REACTMICP_UNSAT_DIR}/transport_constraints.hpp + ${REACTMICP_UNSAT_DIR}/init_variables.hpp + ${REACTMICP_UNSAT_DIR}/variables.hpp + ${REACTMICP_UNSAT_DIR}/transport_stagger.hpp + ${REACTMICP_UNSAT_DIR}/equilibrium_stagger.hpp + ${REACTMICP_UNSAT_DIR}/variables_interface.hpp + ${REACTMICP_UNSAT_DIR}/equilibrium_constraints.hpp +) + set(REACTMICP_EQUILIBRIUMCURVE_INCLUDE_LIST ${REACTMICP_EQUILIBRIUMCURVE}/chemistry.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_extractor.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_coupler.cpp ${REACTMICP_EQUILIBRIUMCURVE}/eqcurve_solid_transport.cpp ) set(REACTMICP_IO_INCLUDE_LIST io/reactive_transport.hpp io/saturated_react.hpp io/configuration.hpp ) install(FILES ${REACTMICP_STAGGERBASE_INCLUDE_LIST} DESTINATION ${INCLUDE_INSTALL_DIR}/reactmicp/solver/staggers_base ) install(FILES ${REACTMICP_SOLVER_INCLUDE_LIST} DESTINATION ${INCLUDE_INSTALL_DIR}/reactmicp/solver ) install(FILES ${REACTMICP_SATURATEDREACT_INCLUDE_LIST} DESTINATION ${INCLUDE_INSTALL_DIR}/reactmicp/systems/saturated_react ) install(FILES ${REACTMICP_EQUILIBRIUMCURVE_INCLUDE_LIST} DESTINATION ${INCLUDE_INSTALL_DIR}/reactmicp/equilibrium_curve ) install(FILES ${REACTMICP_IO_INCLUDE_LIST} DESTINATION ${INCLUDE_INSTALL_DIR}/reactmicp/io ) # static libraries # ---------------- if(SPECMICP_BUILD_STATIC) add_library(reactmicp_static STATIC $) install(TARGETS reactmicp_static ARCHIVE DESTINATION ${STATIC_LIBRARY_INSTALL_DIR} ) else() add_library(reactmicp_static EXCLUDE_FROM_ALL STATIC $) endif() set_target_properties(reactmicp_static PROPERTIES OUTPUT_NAME reactmicp) target_link_libraries(reactmicp_static dfpm_static) diff --git a/src/reactmicp_unsaturated.hpp b/src/reactmicp/systems/unsaturated/init_variables.hpp similarity index 58% copy from src/reactmicp_unsaturated.hpp copy to src/reactmicp/systems/unsaturated/init_variables.hpp index 4791322..03053ae 100644 --- a/src/reactmicp_unsaturated.hpp +++ b/src/reactmicp/systems/unsaturated/init_variables.hpp @@ -1,57 +1,88 @@ /* ============================================================================= Copyright (c) 2014 - 2016 F. Georget 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. * ============================================================================= */ -//! \file reactmicp_unsaturated.hpp -//! \brief The unsaturated system of the ReactMiCP solver +#ifndef SPECMICP_REACTMICP_UNSATURATED_INITVARIABLES_HPP +#define SPECMICP_REACTMICP_UNSATURATED_INITVARIABLES_HPP -#ifndef SPECMICP_REACMICP_UNSATURATED_HPP -#define SPECMICP_REACMICP_UNSATURATED_HPP +//! \file unsaturated/initialize_variables +//! \brief Interface to initialize variables -// Core files +#include -#include "reactmicp_core.hpp" +namespace YAML { + class Node; +} //end namespace YAML -// System +namespace specmicp { -#include "reactmicp/systems/unsaturated/variables_interface.hpp" +namespace database { + struct DataContainer; +} //end namespace database -#include "reactmicp/systems/unsaturated/equilibrium_constraints.hpp" -#include "reactmicp/systems/unsaturated/equilibrium_stagger.hpp" +namespace mesh { + class Mesh1D; +} //end namespace mesh -#include "reactmicp/systems/unsaturated/transport_constraints.hpp" -#include "reactmicp/systems/unsaturated/transport_stagger.hpp" +namespace units { + class UnitsSet; +} //end namespace units -// Output +namespace reactmicp { +namespace systems { +namespace unsaturated { -#endif // SPECMICP_REACMICP_UNSATURATED_HPP +class UnsaturatedVariables; + +//! \brief Virtual Abstract class to initialize variables +class InitialiseVariables +{ +public: + virtual ~InitialiseVariables() = default; + + //! \brief Initialize a variables + virtual std::shared_ptr initialize_variables( + std::shared_ptr the_database, + std::shared_ptr the_mesh, + units::UnitsSet& the_units, + const YAML::Node& configuration + ) = 0; +private: +}; + +} //end namespace unsaturated +} //end namespace systems +} //end namespace reactmicp +} //end namespace specmicp + +#endif // SPECMICP_REACTMICP_UNSATURATED_INITVARIABLES_HPP diff --git a/src/reactmicp_unsaturated.hpp b/src/reactmicp_unsaturated.hpp index 4791322..08633f5 100644 --- a/src/reactmicp_unsaturated.hpp +++ b/src/reactmicp_unsaturated.hpp @@ -1,57 +1,58 @@ /* ============================================================================= Copyright (c) 2014 - 2016 F. Georget 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. * ============================================================================= */ //! \file reactmicp_unsaturated.hpp //! \brief The unsaturated system of the ReactMiCP solver #ifndef SPECMICP_REACMICP_UNSATURATED_HPP #define SPECMICP_REACMICP_UNSATURATED_HPP // Core files #include "reactmicp_core.hpp" // System #include "reactmicp/systems/unsaturated/variables_interface.hpp" +#include "reactmicp/systems/unsaturated/init_variables.hpp" #include "reactmicp/systems/unsaturated/equilibrium_constraints.hpp" #include "reactmicp/systems/unsaturated/equilibrium_stagger.hpp" #include "reactmicp/systems/unsaturated/transport_constraints.hpp" #include "reactmicp/systems/unsaturated/transport_stagger.hpp" // Output #endif // SPECMICP_REACMICP_UNSATURATED_HPP