Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F91078683
variables.cpp
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
Thu, Nov 7, 15:56
Size
3 KB
Mime Type
text/x-c
Expires
Sat, Nov 9, 15:56 (2 d)
Engine
blob
Format
Raw Data
Handle
22191921
Attached To
rSPECMICP SpecMiCP / ReactMiCP
variables.cpp
View Options
/* =============================================================================
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. *
============================================================================= */
#include "variables.hpp"
#include "dfpm/mesh.hpp"
#include "specmicp_common/physics/laws.hpp"
namespace specmicp {
namespace reactmicp {
namespace systems {
namespace chloride {
ChlorideVariables::ChlorideVariables(
RawDatabasePtr adata,
mesh::Mesh1DPtr amesh,
const units::UnitsSet& tunits
):
DatabaseHolder(adata),
UnitBaseClass(tunits),
m_mesh(amesh),
m_numbering(adata->nb_component()),
m_constants(tunits)
{
}
void ChlorideVariables::reset_main_variables()
{
// ###TODO
}
ChlorideVariables::ConstantBox::ConstantBox(const units::UnitsSet& tunits)
{
rho_w = laws::density_water(units::celsius(25.0), tunits.length, tunits.mass);
faraday = constants::faraday_constant;
rt = constants::gas_constant*units::celsius(25.0);
}
Vector ChlorideVariables::get_element_dofs(
index_t element,
const Vector& values
) const
{
const auto start_node = m_mesh->get_node(element, 0);
const auto dof_start = dof_component(start_node, 2);
return values.segment(dof_start, 2*ndof());
}
Vector ChlorideVariables::get_nodal_dofs(
index_t node,
const Vector& values
) const
{
const auto dof_start = dof_component(node, 2);
return values.segment(dof_start, ndof());
}
} // namespace chloride
} // namespace systems
} // namespace reactmicp
} // namespace specmicp
Event Timeline
Log In to Comment