5 #include <deal.II/distributed/solution_transfer.h> 6 #include <deal.II/fe/fe_q.h> 7 #include <deal.II/fe/fe_values.h> 8 #include <deal.II/lac/la_parallel_vector.h> 13 #include "dg/dg_base.hpp" 14 #include "functional.h" 15 #include "parameters/all_parameters.h" 16 #include "physics/physics.h" 34 #if PHILIP_DIM==1 // dealii::parallel::distributed::Triangulation<dim> does not work for 1D 35 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType = dealii::Triangulation<dim>>
37 template <
int dim,
int nspecies,
int nstate,
typename real,
typename MeshType = dealii::parallel::distributed::Triangulation<dim>>
121 std::shared_ptr< DGBase<dim,nspecies,real,MeshType> >
dg;
123 std::shared_ptr< Functional<dim, nspecies, nstate, real, MeshType> >
functional;
125 std::shared_ptr< Physics::PhysicsBase<dim,nspecies,nstate,Sacado::Fad::DFad<real>> >
physics;
132 dealii::LinearAlgebra::distributed::Vector<real>
dIdw_fine;
159 #endif // __ADJOINT_H__ dealii::Vector< real > dual_weighted_residual_fine
dual weighted residual
void output_results_vtk(const unsigned int cycle)
Outputs the current solution and adjoint values.
void reinit()
Reinitialize Adjoint with the same pointers.
Base class from which Advection, Diffusion, ConvectionDiffusion, and Euler is derived.
dealii::LinearAlgebra::distributed::Vector< real > fine_grid_adjoint()
Computes the fine grid adjoint.
Files for the baseline physics.
dealii::LinearAlgebra::distributed::Vector< real > dIdw_fine
functional derivative (on the fine grid)
AdjointStateEnum adjoint_state
Current adjoint state.
AdjointStateEnum
For storing the current state in the adjoint.
dealii::LinearAlgebra::distributed::Vector< real > adjoint_fine
fine grid adjoint ( )
void coarse_to_fine()
Projects the problem to a p-enriched space.
std::shared_ptr< MeshType > triangulation
Grid.
void convert_to_state(AdjointStateEnum state)
Converts the adjoint to specified state.
dealii::LinearAlgebra::distributed::Vector< real > adjoint_coarse
coarse grid adjoint ( )
std::shared_ptr< Functional< dim, nspecies, nstate, real, MeshType > > functional
Functional class pointer.
dealii::LinearAlgebra::distributed::Vector< real > solution_coarse
original solution
dealii::LinearAlgebra::distributed::Vector< real > dIdw_coarse
functional derivative (on the coarse grid)
void fine_to_coarse()
Return the problem to the original solution and polynomial distribution.
std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, Sacado::Fad::DFad< real > > > physics
Problem physics (for calling the functional class)
dealii::LinearAlgebra::distributed::Vector< real > coarse_grid_adjoint()
Computes the coarse grid adjoint.
Adjoint(std::shared_ptr< DGBase< dim, nspecies, real, MeshType > > _dg, std::shared_ptr< Functional< dim, nspecies, nstate, real, MeshType > > _functional, std::shared_ptr< Physics::PhysicsBase< dim, nspecies, nstate, Sacado::Fad::DFad< real >> > _physics)
Constructor.
dealii::Vector< real > dual_weighted_residual()
compute the Dual Weighted Residual (DWR)
dealii::ConditionalOStream pcout
Parallel std::cout that only outputs on mpi_rank==0.
DGBase is independent of the number of state variables.
dealii::Vector< real > coarse_fe_index
Original FE_index distribution.
MPI_Comm mpi_communicator
MPI communicator.
std::shared_ptr< DGBase< dim, nspecies, real, MeshType > > dg
DG class pointer.