Generic Component: A Generic Programming Approach

Author(s):  
Chen Yewang ◽  
Jiang Zhixiong ◽  
Zhao Wenyun ◽  
Peng Xin
2022 ◽  
Vol 15 (1) ◽  
pp. 75-104
Author(s):  
Niccolò Tubini ◽  
Riccardo Rigon

Abstract. This paper presents WHETGEO and its 1D deployment: a new physically based model simulating the water and energy budgets in a soil column. The purpose of this contribution is twofold. First, we discuss the mathematical and numerical issues involved in solving the Richardson–Richards equation, conventionally known as the Richards equation, and the heat equation in heterogeneous soils. In particular, for the Richardson–Richards equation (R2) we take advantage of the nested Newton–Casulli–Zanolli (NCZ) algorithm that ensures the convergence of the numerical solution in any condition. Second, starting from numerical and modelling needs, we present the design of software that is intended to be the first building block of a new customizable land-surface model that is integrated with process-based hydrology. WHETGEO is developed as an open-source code, adopting the object-oriented paradigm and a generic programming approach in order to improve its usability and expandability. WHETGEO is fully integrated into the GEOframe/OMS3 system, allowing the use of the many ancillary tools it provides. Finally, the paper presents the 1D deployment of WHETGEO, WHETGEO-1D, which has been tested against the available analytical solutions presented in the Appendix.


Author(s):  
Vinícius Mello ◽  
Luiz Velho ◽  
Paulo Roma Cavalcanti ◽  
Cláudio T. Silva

2017 ◽  
Vol 1 (2) ◽  
pp. 192 ◽  
Author(s):  
Harmes Harmes ◽  
Bambang Juanda ◽  
Ernan Rustiadi ◽  
Baba Barus

Anti-poverty programs and policies are designed similar for all regions in Indonesia, disregarding the local socio-culture and the poverty spatial pattern of the regions. The approach is based on central government’s program and not based on each region’s locality. This generic programming approach caused the achievement of development goals decline. The effect of space on poverty can be identified by the presence of spatial autocorrelation, which is the link between the examined variable to itself in a spatial manner or commonly referred to as spatial dependence.The aim of this paper is to investigate the global and local spatial autocorrelation for micro poverty data set in Bengkulu City in order to identify spatial approach for its anti-poverty program. Global Moran Index (MI) tests identifies the overall occurrence of autocorrelation, meanwhile the local spatial test shows which subdistricts has the presence of autocorrelation. Global and local MI are popular tools utilized to calculate the spatial effect, particularly to present spatial dependencies. The relation between urban village linkages obtained an MI value of 0.322. This MI value indicates the presence of spatial autocorrelation for subdistricts located in cluster. In local spatial effect observation using Local Indicator of Spatial Autocorrelation (LISA), its discovered that there are several subdistricts having autocorrelation, meanwhile the rest are not significant. Cluster mapping on global MI and LISA shows high-high poverty districts are located in the south of the city, low-high poverty districts in the east, and low-low high-low poverty districts near the city center.


2021 ◽  
Author(s):  
Niccolò Tubini ◽  
Riccardo Rigon

Abstract. This paper presents WHETGEO and its 1D deployment, a new, physically based model simulating the water and energy budgets in a soil column. The purpose of this contribution is twofold. First, we discuss the mathematical and numerical issues involved in solving the Richardson-Richards equation, conventionally known as Richards' equation, and the heat equation in heterogeneous soils. In particular, for the Richardson-Richards equation (R2) we take advantage of the nested Newton-Casulli-Zanolli (NCZ) algorithm that ensures the convergence of the numerical solution in any condition. Second, starting from numerical and modelling needs, we present the design of a software that is intended to be the first building block of a new, customisable, land-surface model that is integrated with process-based hydrology. WHETGEO is developed as an open-source code, adopting the Object-Oriented paradigm and a generic programming approach in order to improve its usability and expandability. WHETGEO is fully integrated in the GEOframe/OMS3 system allowing the use of the many ancillary tools it provides. Finally the paper presents the 1D deployment of WHETGEO, WHETGEO-1D, which has been tested against the available analytical solutions presented in Appendix.


2010 ◽  
Vol 1 (1) ◽  
pp. 1-9
Author(s):  
Martin Däumler ◽  
Dirk Müller ◽  
Matthias Werner

Today’s widely used programming approach formobile distributed systems, e.g., swarms, is bottom-up. I.e.,the programmer has to be aware of the system’s distribution.Such a kind of programming corrupts the principle Separationof Concerns and turns out to be complicated. Thisarticle proposes a top-down approach for the programmingof mobile distributed systems. It should be incorporated in anew operating system to be developed by our research group.Classical distributed systems often are intended to hidetheir distribution from the user but not stringently from theprogrammer. Moreover, most applications don’t consider theexecuting system’s location and mobility, respectively. However,state-of-the-art mobile distributed systems’ applicationsare widely based on location and motion data. So, the programmingapproach of classical distributed systems whichabstracts from location and motion might no longer be convenient.We suggest raising the level of abstraction in orderto hide the system’s distribution from the user and programmer,in contrast to the bottom-up programming approach of,e.g., swarms. This distribution transparency within the executingsystem is intended to be combined with location/-motion awareness within the application so that the requirementsof modern applications can be met. The programmingof such a distributed mobile system will be separated fromthe complex and error-prone application partitioning and assignmenta bottom-up approach would impose. This offersfurther benefits like scalability and robustness with regard toscheduling of sub-activities and sub-systems, respectively.We promote the use of spatiotemporal constraints to realizesuch a top-down approach. These constraints will be introducedand explained using two examples.


2012 ◽  
Vol 20 (3) ◽  
pp. 327-345 ◽  
Author(s):  
Roger P. Pawlowski ◽  
Eric T. Phipps ◽  
Andrew G. Salinger ◽  
Steven J. Owen ◽  
Christopher M. Siefert ◽  
...  

A template-based generic programming approach was presented in Part I of this series of papers [Sci. Program. 20 (2012), 197–219] that separates the development effort of programming a physical model from that of computing additional quantities, such as derivatives, needed for embedded analysis algorithms. In this paper, we describe the implementation details for using the template-based generic programming approach for simulation and analysis of partial differential equations (PDEs). We detail several of the hurdles that we have encountered, and some of the software infrastructure developed to overcome them. We end with a demonstration where we present shape optimization and uncertainty quantification results for a 3D PDE application.


2013 ◽  
Vol 21 (1-2) ◽  
pp. 43-61
Author(s):  
Bruno Bachelet ◽  
Antoine Mahul ◽  
Loïc Yon

In generic programming, software components are parameterized on types. When available, a static specialization mechanism allows selecting, for a given set of parameters, a more suitable version of a generic component than its primary version. The normal C++ template specialization mechanism is based on the type pattern of the parameters, which is not always the best way to guide the specialization process: type patterns are missing some information on types that could be relevant to define specializations. The notion of a concept, which represents a set of requirements (including syntactic and semantic aspects) for a type, is known to be an interesting approach to control template specialization. For many reasons, concepts were dropped from C++11 standard, this article therefore describes template metaprogramming techniques for declaring concepts, modeling relationships (meaning that a type fulfills the requirements of a concept), and refinement relationships (meaning that a concept refines the requirements of another concept). From a taxonomy of concepts and template specializations based on concepts, an automatic mechanism selects the most appropriate version of a generic component for a given instantiation. Our purely library-based solution is also open for retroactive extension: new concepts, relationships, and template specializations can be defined at any time; such additions will then be picked up by the specialization mechanism.


Sign in / Sign up

Export Citation Format

Share Document