Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F74419601
jacobian_approximation.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
Sat, Jul 27, 18:08
Size
3 KB
Mime Type
text/x-c
Expires
Mon, Jul 29, 18:08 (2 d)
Engine
blob
Format
Raw Data
Handle
19388185
Attached To
rSPECMICP SpecMiCP / ReactMiCP
jacobian_approximation.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 "jacobian_approximation.hpp"
#include "specmicp_common/micpsolver/micpsolver_structs.hpp"
#include "specmicp/adimensional/adimensional_system_structs.hpp"
namespace
specmicp
{
namespace
reactmicp
{
namespace
systems
{
namespace
chloride
{
// ===== No approximation =====
ApproxReturnCode
NoApproximation
::
perturb
(
index_t
node
,
index_t
_
,
scalar_t
__
,
scalar_t
___
,
AdimensionalSystemSolution
&
sol
)
{
m_sol_cache
=
sol
;
auto
constraints
=
m_get_constraints
(
node
,
m_vars
.
get
());
auto
ret
=
m_solver
(
node
,
constraints
,
sol
,
sol
);
auto
retcode
=
ApproxReturnCode
::
Ok
;
if
(
ret
<
micpsolver
::
MiCPSolverReturnCode
::
Success
)
{
return
ApproxReturnCode
::
Error
;
}
return
retcode
;
}
void
NoApproximation
::
restore
(
AdimensionalSystemSolution
&
sol
)
{
sol
=
m_sol_cache
;
}
// ======= Dominant species approximation ======
ApproxReturnCode
DominantSpeciesApproximation
::
perturb
(
index_t
node
,
index_t
component
,
scalar_t
perturbation
,
scalar_t
dt
,
AdimensionalSystemSolution
&
sol
)
{
// TODO
}
void
DominantSpeciesApproximation
::
restore
(
AdimensionalSystemSolution
&
sol
)
{
/// TODO
}
}
// namespace chloride
}
// namespace systems
}
// namespace reactmicp
}
// namespace specmicp
Event Timeline
Log In to Comment