2 research outputs found

    Fake Run-Time Selection of Template Arguments in C++

    Full text link
    C++ does not support run-time resolution of template type arguments. To circumvent this restriction, we can instantiate a template for all possible combinations of type arguments at compile time and then select the proper instance at run time by evaluation of some provided conditions. However, for templates with multiple type parameters such a solution may easily result in a branching code bloat. We present a template metaprogramming algorithm called for_id that allows the user to select the proper template instance at run time with theoretical minimum sustained complexity of the branching code.Comment: Objects, Models, Components, Patterns (50th International Conference, TOOLS 2012

    The Polarizable Continuum Model Goes Viral! Extensible, Modular and Sustainable Development of Quantum Mechanical Continuum Solvation Models

    Get PDF
    Synergistic theoretical and experimental approaches to challenging chemical problems have become more and more widespread, due to the availability of efficient and accurate ab initio quantum chemical models. Limitations to such an approach do, however, still exist. The vast majority of chemical phenomena happens in complex environments, where the molecule of interest can interact with a large number of other moieties, solvent molecules or residues in a protein. These systems represent an ongoing challenge to our modelling capabilities, especially when high accuracy is required for the prediction of exotic and novel molecular properties. How to achieve the insight needed to understand and predict the physics and chemistry of such complex systems is still an open question. I will present our efforts in answering this question based on the development of the polarizable continuum model for solvation. While the solute is described by a quantum mechanical method, the surrounding environment is replaced by a structureless continuum dielectric. The mutual polarization of the solute-environment system is described by classical electrostatics. Despite its inherent simplifications, the model contains the basic mathematical features of more refined explicit quantum/classical polarizable models. Leveraging this fundamental similarity, we show how the inclusion of environment effects for relativistic and nonrelativistic quantum mechanical Hamiltonians, arbitrary order response properties and high-level electron correlation methods can be transparently derived and implemented. The computer implementation of the polarizable continuum model is central to the work presented in this dissertation. The quantum chemistry software ecosystem suffers from a growing complexity. Modular programming offers an extensible, flexible and sustainable paradigm to implement new features with reduced effort. PCMSolver, our open-source application programming interface, can provide continuum solvation functionality to any quantum chemistry software: continuum solvation goes viral. Our strategy affords simpler programming workflows, more thorough testing and lower overall code complexity. As examples of the flexibility of our implementation approach, we present results for the continuum modelling of non homogeneous environments and how wavelet-based numerical methods greatly outperform the accuracy of traditional methods usually employed in continuum solvation models
    corecore