  For the general class of residual distribution (RD) schemes, including many
finite element (such as continuous/discontinuous Galerkin) and flux
reconstruction methods, an approach to construct entropy conservative/
dissipative semidiscretizations by adding suitable correction terms has been
proposed by Abgrall (J.~Comp.~Phys. 372: pp. 640--666, 2018). In this work, the
correction terms are characterized as solutions of certain optimization
problems and are adapted to the SBP-SAT framework, focusing on discontinuous
Galerkin methods. Novel generalizations to entropy inequalities, multiple
constraints, and kinetic energy preservation for the Euler equations are
developed and tested in numerical experiments. For all of these optimization
problems, explicit solutions are provided. Additionally, the correction
approach is applied for the first time to obtain a fully discrete entropy
conservative/dissipative RD scheme. Here, the application of the deferred
correction (DeC) method for the time integration is essential. This paper can
be seen as describing a systematic method to construct structure preserving
discretization, at least for the considered example.
