-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from Adrian-Diaz/Parallel-Explicit-Solver
MPI solvers update
- Loading branch information
Showing
25 changed files
with
738 additions
and
413 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
133 changes: 133 additions & 0 deletions
133
src/Parallel-Solvers/Optimization_Modules/Fierro_Optimization_Objective.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
// @HEADER | ||
// ************************************************************************ | ||
// | ||
// Rapid Optimization Library (ROL) Package | ||
// Copyright (2014) Sandia Corporation | ||
// | ||
// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive | ||
// license for use of this work by or on behalf of the U.S. Government. | ||
// | ||
// 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 Corporation nor the names of the | ||
// contributors may be used to endorse or promote products derived from | ||
// this software without specific prior written permission. | ||
// | ||
// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "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 SANDIA CORPORATION OR THE | ||
// 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. | ||
// | ||
// Questions? Contact lead developers: | ||
// Drew Kouri ([email protected]) and | ||
// Denis Ridzal ([email protected]) | ||
// | ||
// ************************************************************************ | ||
// @HEADER | ||
|
||
#ifndef FIERRO_OPTIMIZATION_OBJECTIVE_H | ||
#define FIERRO_OPTIMIZATION_OBJECTIVE_H | ||
|
||
#include <string> | ||
#include <Teuchos_ScalarTraits.hpp> | ||
#include <Teuchos_RCP.hpp> | ||
#include <Teuchos_oblackholestream.hpp> | ||
#include <Teuchos_Tuple.hpp> | ||
#include <Teuchos_VerboseObject.hpp> | ||
|
||
#include <Tpetra_Core.hpp> | ||
#include <Tpetra_Map.hpp> | ||
#include <Tpetra_MultiVector.hpp> | ||
#include "Tpetra_Details_DefaultTypes.hpp" | ||
|
||
#include "ROL_Types.hpp" | ||
#include <ROL_TpetraMultiVector.hpp> | ||
#include "ROL_Elementwise_Reduce.hpp" | ||
#include "ROL_Objective.hpp" | ||
#include "ROL_BoundConstraint.hpp" | ||
|
||
/** @ingroup func_group | ||
\class ROL::ObjectiveMMA | ||
\brief Provides the interface to to Method of Moving Asymptotes | ||
Objective function | ||
--- | ||
*/ | ||
|
||
class FierroOptimizationObjective : public ROL::Objective<real_t> { | ||
|
||
typedef Tpetra::Map<>::local_ordinal_type LO; | ||
typedef Tpetra::Map<>::global_ordinal_type GO; | ||
typedef Tpetra::Map<>::node_type Node; | ||
typedef Tpetra::Map<LO, GO, Node> Map; | ||
typedef Tpetra::MultiVector<real_t, LO, GO, Node> MV; | ||
typedef ROL::Vector<real_t> V; | ||
typedef const ROL::Vector<real_t> const_V; | ||
typedef ROL::TpetraMultiVector<real_t,LO,GO,Node> ROL_MV; | ||
|
||
using traits = Kokkos::ViewTraits<LO*, Kokkos::LayoutLeft, void, void>; | ||
using array_layout = typename traits::array_layout; | ||
using execution_space = typename traits::execution_space; | ||
using device_type = typename traits::device_type; | ||
using memory_traits = typename traits::memory_traits; | ||
using global_size_t = Tpetra::global_size_t; | ||
|
||
typedef Kokkos::View<real_t*, Kokkos::LayoutRight, device_type, memory_traits> values_array; | ||
typedef Kokkos::View<GO*, array_layout, device_type, memory_traits> global_indices_array; | ||
typedef Kokkos::View<LO*, array_layout, device_type, memory_traits> indices_array; | ||
|
||
//typedef Kokkos::DualView<real_t**, Kokkos::LayoutLeft, device_type>::t_dev vec_array; | ||
typedef MV::dual_view_type::t_dev vec_array; | ||
typedef MV::dual_view_type::t_host host_vec_array; | ||
typedef Kokkos::View<const real_t**, array_layout, HostSpace, memory_traits> const_host_vec_array; | ||
typedef MV::dual_view_type dual_vec_array; | ||
typedef ROL::Objective<real_t> OBJ; | ||
typedef ROL::BoundConstraint<real_t> BND; | ||
int update_count = 0; | ||
|
||
private: | ||
|
||
real_t fval_; // Original objective value | ||
|
||
real_t tol_; | ||
|
||
ROL::Ptr<const MV> getVector( const V& x ) { | ||
return dynamic_cast<const ROL_MV&>(x).getVector(); | ||
} | ||
|
||
ROL::Ptr<MV> getVector( V& x ) { | ||
return dynamic_cast<ROL_MV&>(x).getVector(); | ||
} | ||
|
||
public: | ||
|
||
bool time_accumulation; | ||
real_t objective_accumulation; | ||
|
||
FierroOptimizationObjective(){ | ||
objective_accumulation = 0; | ||
time_accumulation = false; | ||
} | ||
|
||
|
||
}; // class ObjectiveMMA | ||
|
||
|
||
#endif // FIERRO_MMA_OBJECTIVE | ||
|
84 changes: 84 additions & 0 deletions
84
src/Parallel-Solvers/Parallel-Explicit/Example_Yaml_Scripts/example_implosion.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
num_dims: 3 | ||
dynamic_options: | ||
time_final: 20.0 | ||
dt_min: 1.e-8 | ||
dt_max: 1.e-2 | ||
dt_start: 1.e-5 | ||
cycle_stop: 2000000 | ||
|
||
mesh_generation_options: | ||
type: Box | ||
origin: [0, 0, 0] | ||
length: [1.2, 1.2, 1.2] | ||
num_elems: [32, 32, 32] | ||
|
||
output_options: | ||
timer_output_level: thorough | ||
output_file_format: vtk | ||
graphics_step: 0.25 | ||
|
||
fea_module_parameters: | ||
- type: SGH | ||
material_id: 0 | ||
boundary_conditions: | ||
# Tag X plane | ||
- surface: | ||
type: x_plane | ||
plane_position: 0.0 | ||
type: reflected | ||
|
||
# Tag Y plane | ||
- surface: | ||
type: y_plane | ||
plane_position: 0.0 | ||
type: reflected | ||
|
||
# Tag Z plane | ||
- surface: | ||
type: z_plane | ||
plane_position: 0.0 | ||
type: reflected | ||
|
||
loading_conditions: | ||
# Load radially around 0 0 0 corner | ||
- volume: | ||
type: sphere | ||
radius1: 1.0 | ||
radius2: 2.5 | ||
type: body_force | ||
component_x: -0.00000005 | ||
component_y: -0.00000005 | ||
component_z: -0.00000005 | ||
|
||
materials: | ||
- id: 0 | ||
eos_model: ideal_gas | ||
strength_model: none | ||
elastic_modulus: 10 | ||
poisson_ratio: 0.3 | ||
maximum_limiter: 1 | ||
q1: 2.0 | ||
q2: 4.0 | ||
q1ex: 2.0 | ||
q2ex: 4.0 | ||
eos_global_vars: | ||
- 1.666666666666667 | ||
- 1.0E-14 | ||
- 1.0 | ||
|
||
regions: | ||
- volume: | ||
type: global | ||
material_id: 0 | ||
den: 1.0 | ||
sie: 1.e-10 | ||
|
||
velocity: cartesian | ||
u: 0.0 | ||
v: 0.0 | ||
w: 0.0 | ||
|
||
velocity: cartesian | ||
u: 0.0 | ||
v: 0.0 | ||
w: 0.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.