[P]arallel [Hi]gh-order [Li]brary for [P]DEs  Latest
Parallel High-Order Library for PDEs through hp-adaptive Discontinuous Galerkin methods
base_parameterization.hpp
1 #ifndef __DESIGN_PARAMETERIZATION_BASE_H__
2 #define __DESIGN_PARAMETERIZATION_BASE_H__
3 
4 #include "mesh/high_order_grid.h"
5 
6 namespace PHiLiP {
7 
9 template<int dim>
11 
12  using VectorType = dealii::LinearAlgebra::distributed::Vector<double>;
13  using MatrixType = dealii::TrilinosWrappers::SparseMatrix;
14 
15 public:
17  explicit BaseParameterization(std::shared_ptr<HighOrderGrid<dim,double>> _high_order_grid);
18 
20  virtual ~BaseParameterization() = default;
21 
23  virtual void initialize_design_variables(VectorType &design_var) = 0;
24 
27  const MatrixType &dXv_dXp,
28  const VectorType &design_var) = 0;
29 
31  virtual void compute_dXv_dXp(MatrixType &dXv_dXp) const = 0;
32 
34  virtual void output_design_variables(const unsigned int /*iteration_no*/) const;
35 
37  virtual unsigned int get_number_of_design_variables() const = 0;
38 
40  bool has_design_variable_been_updated(const VectorType &current_design_var, const VectorType &updated_design_var) const;
41 
43  std::shared_ptr<HighOrderGrid<dim,double>> high_order_grid;
44 
46  MPI_Comm mpi_communicator;
47 
49  dealii::ConditionalOStream pcout;
50 
52  int mpi_rank;
53 
55  int n_mpi;
56 };
57 
58 } // PHiLiP namespace
59 
60 #endif
int n_mpi
Total no. of processors.
int mpi_rank
Processor# of current processor.
BaseParameterization(std::shared_ptr< HighOrderGrid< dim, double >> _high_order_grid)
Constructor.
virtual unsigned int get_number_of_design_variables() const =0
Returns the number of design variables. To be implemented by derived classes.
bool has_design_variable_been_updated(const VectorType &current_design_var, const VectorType &updated_design_var) const
Checks if the design variable has changed.
Files for the baseline physics.
Definition: ADTypes.hpp:10
dealii::TrilinosWrappers::SparseMatrix MatrixType
Alias for dealii::TrilinosWrappers::SparseMatrix.
Abstract class for design parameterization. Objective function and the constraints take this class&#39;s ...
virtual void compute_dXv_dXp(MatrixType &dXv_dXp) const =0
Computes derivative of volume nodes w.r.t. design parameters.
virtual bool update_mesh_from_design_variables(const MatrixType &dXv_dXp, const VectorType &design_var)=0
Checks if the design variable has changed and updates volume nodes based on the parameterization.
MPI_Comm mpi_communicator
Alias for MPI_COMM_WORLD.
std::shared_ptr< HighOrderGrid< dim, double > > high_order_grid
Pointer to high order grid.
virtual ~BaseParameterization()=default
Destructor.
virtual void initialize_design_variables(VectorType &design_var)=0
Initialize design variables and set locally owned and ghost indices.
dealii::LinearAlgebra::distributed::Vector< double > VectorType
Alias for dealii&#39;s parallel distributed vector.
dealii::ConditionalOStream pcout
std::cout only on processor #0.
virtual void output_design_variables(const unsigned int) const
Outputs design variables. Doesn&#39;t output anything if not overridden.