| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// Rapid Optimization Library (ROL) Package |
| 4 |
// |
| 5 |
// Copyright 2014 NTESS and the ROL contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef ROL_PDEOPT_ELASTICITY_SIMP_DATA_H |
| 11 |
#define ROL_PDEOPT_ELASTICITY_SIMP_DATA_H |
| 12 |
|
| 13 |
#include "Intrepid_HGRAD_QUAD_C2_FEM.hpp" |
| 14 |
#include "Intrepid_HGRAD_QUAD_C1_FEM.hpp" |
| 15 |
#include "../TOOLS/elasticitySIMP.hpp" |
| 16 |
|
| 17 |
template<class Real> |
| 18 |
class ElasticitySIMPData : public ElasticitySIMP <Real> { |
| 19 |
|
| 20 |
private: |
| 21 |
using GO = typename Tpetra::Map<>::global_ordinal_type; |
| 22 |
|
| 23 |
public: |
| 24 |
|
| 25 |
ElasticitySIMPData(const ROL::Ptr<const Teuchos::Comm<int> > &comm, |
| 26 |
const Teuchos::RCP<Teuchos::ParameterList> &parlist, |
| 27 |
const ROL::Ptr<std::ostream> &outStream) |
| 28 |
{ |
| 29 |
this->ElasticitySIMP_Initialize(comm, parlist, outStream); |
| 30 |
Real iniDens = parlist->sublist("ElasticitySIMP").get("Initial Density", 1.0); |
| 31 |
this->initDensity_ = iniDens; |
| 32 |
std::cout<<"initial density: "<<iniDens<<std::endl; |
| 33 |
// |
| 34 |
this->SetSIMPParallelStructure(); |
| 35 |
this->SetUpLocalIntrepidArrays(); |
| 36 |
this->ComputeLocalSystemMats(true); |
| 37 |
this->AssembleSystemGraph(); |
| 38 |
this->AssembleSystemMats(); |
| 39 |
//Setup DBC information, do not specify any bc sides, use coordinates to determine the BC instead |
| 40 |
std::vector<GO> dbc_side {}; |
| 41 |
this->SetUpMyDBCInfo(true, dbc_side); |
| 42 |
//Setup all loads |
| 43 |
this->process_loading_information(parlist); |
| 44 |
this->ComputeLocalForceVec(); |
| 45 |
this->AssembleRHSVector(); |
| 46 |
// |
| 47 |
this->EnforceDBC(); |
| 48 |
this->ConstructSolvers(); |
| 49 |
//test_mats(); |
| 50 |
} |
| 51 |
|
| 52 |
}; // class ElasticitySIMPData |
| 53 |
|
| 54 |
#endif |