Engineering Papers⌕ Search

SEARCH · Engineering Papers

Results for “C CODES”

Search indexed NASA NTRS and DOE OSTI research on propulsion, heat transfer, battery materials and energy systems. Follow report and document links to the original sources.

Quote a phrase for an exact phrase match. Source license links do not imply unrestricted reuse.

At least 19 records

User's manual for three dimensional FDTD version C code for scattering from frequency-independent dielectric and magnetic materials

The Penn State Finite Difference Time Domain Electromagnetic Scattering Code Version C is a three dimensional numerical electromagnetic scattering code based upon the Finite Difference Time Domain Technique (FDTD). The supplied version of the code is one version of our current three dimensional FDTD code set. This manual provides a description of the code and corresponding results for several scattering problems. The manual is organized into fourteen sections: introduction, description of the FDTD method, operation, resource requirements, Version C code capabilities, a brief description of the default scattering geometry, a brief description of each subroutine, a description of the include file (COMMONC.FOR), a section briefly discussing Radar Cross Section (RCS) computations, a section discussing some scattering results, a sample problem setup section, a new problem checklist, references and figure titles.

Beggs, John H.↗

User's manual for three dimensional FDTD version C code for scattering from frequency-independent dielectric and magnetic materials

The Penn State Finite Difference Time Domain Electromagnetic Scattering Code Version C is a three-dimensional numerical electromagnetic scattering code based on the Finite Difference Time Domain (FDTD) technique. The supplied version of the code is one version of our current three-dimensional FDTD code set. The manual given here provides a description of the code and corresponding results for several scattering problems. The manual is organized into 14 sections: introduction, description of the FDTD method, operation, resource requirements, Version C code capabilities, a brief description of the default scattering geometry, a brief description of each subroutine, a description of the include file (COMMONC.FOR), a section briefly discussing radar cross section computations, a section discussing some scattering results, a new problem checklist, references, and figure titles.

Beggs, John H.↗

Automatic Differentiation of C++ Codes on Emerging Manycore Architectures with Sacado

Automatic differentiation (AD) is a well-known technique for evaluating analytic derivatives of calculations implemented on a computer, with numerous software tools available for incorporating AD technology into complex applications. However, a growing challenge for AD is the efficient differentiation of parallel computations implemented on emerging manycore computing architectures such as multicore CPUs, GPUs, and accelerators as these devices become more pervasive. In this work, we explore forward mode, operator overloading-based differentiation of C++ codes on these architectures using the widely available Sacado AD software package. In particular, we leverage Kokkos, a C++ tool providing APIs for implementing parallel computations that is portable to a wide variety of emerging architectures. Here we describe the challenges that arise when differentiating code for these architectures using Kokkos, and two approaches for overcoming them that ensure optimal memory access patterns as well as expose additional dimensions of fine-grained parallelism in the derivative calculation. We describe the results of several computational experiments that demonstrate the performance of the approach on a few contemporary CPU and GPU architectures. We then conclude with applications of these techniques to the simulation of discretized systems of partial differential equations.

97 MATHEMATICS AND COMPUTING↗

PolyFit: A C++ code for Polynomial Curve Fit with Calculation of Error Bars

In radiobiology, many dose-response results are modeled using the so-called linear-quadratic (LQ)model, which means that results are modeled as a function of dose Das 𝑅(𝐷)=𝛽0+𝛽1𝐷+𝛽2𝐷2. The coefficients 𝛽0, 𝛽1and 𝛽2are obtained from fitting a series of data points (𝑥𝑖, 𝑦𝑖), which is usually done using a least-square method. The LQ and more generally the polynomial fit capability is implemented in many software that analyzes data. However, there are some instances where the fitting needs to be done programmatically. Furthermore, depending on the software used, some features may not be implemented. In this mini-review, I discuss the basis of polynomial fitting, including the calculation of errors on the coefficients and results, use of weighting and fixing the intercept value (the coefficient 𝛽0). A simple C++ code to perform the polynomial curve fitting is also provided. This code should be useful not only in radiobiology but in other fields of science as well.

Ianik Plante↗

PolyFit: A C++ code for Polynomial Curve Fit with Calculation of Error Bars

In radiobiology, many dose-response results are modeled using the so-called linear-quadratic(LQ)model, which means that results are modeled as a function of dose Das 𝑅(𝐷)=𝛽0+𝛽1𝐷+𝛽2𝐷2. The coefficients 𝛽0, 𝛽1and 𝛽2are obtained from fitting a series of data points (𝑥𝑖,𝑦𝑖), which is usually done using a least-square method. The LQ and more generally the polynomial fit capability is implemented in many software that analyzes data. However, it is often convenient to do the fitting programmatically, especially when a large number of datasets should be analyzed. Furthermore, depending on the software used, some features may not be implemented. In this mini-review, I discuss the basis of polynomial fitting, including the calculation of errors on the coefficients and results, use of weighting and fixing the intercept value (the coefficient 𝛽0). A simple C++ code to perform the polynomial curve fitting is also provided. This code should be useful not only in radiobiology but in other fields of science as well.

Ianik Plante↗

Portable C++ Code that can Look and Feel Like Fortran Code with Yet Another Kernel Launcher (YAKL)

This paper introduces the Yet Another Kernel Launcher (YAKL) C++ portability library, which strives to enable user-level code with the look and feel of Fortran code. The intended audience includes both C++ developers and Fortran developers unfamiliar with C++. The C++ portability approach is briefly explained, YAKL’s main features are described, and code examples are given that demonstrate YAKL’s usage. YAKL fills a niche capability important particularly to scientific applications seeking to port Fortran code quickly to a portable C++ library. YAKL places heavy emphasis on simplicity, readability, and productivity with performance mainly emphasizing Graphics Processing Units (GPUs). Central to YAKL’s ability to allow Fortran-like user-level code are three features: (1) a multi-dimensional Array class that allows Fortran behavior; (2) a limited library of Fortran intrinsic functions; and (3) an efficient pool allocator that transparently enables cheap frequent allocations and deallocations of YAKL Arrays. While YAKL allows Fortran-style code, it also allows Arrays that exhibit C-like behavior as well, including row-major index ordering and lower bounds of “0”. YAKL currently supports CPUs, CPU threading, and Nvidia, AMD, and Intel GPUs.

97 MATHEMATICS AND COMPUTING↗

C++ Coding Standards and Style Guide

This document is based on the "C Style Guide" (SEL-94-003). It contains recommendations for C++ implementations that build on, or in some cases replace, the style described in the C style guide. Style guidelines on any topics that are not covered in this document can be found in the "C Style Guide." An attempt has been made to indicate when these recommendations are just guidelines or suggestions versus when they are more strongly encouraged. Using coding standards makes code easier to read and maintain. General principles that maximize the readability and maintainability of C++ are: (1) Organize classes using encapsulation and information hiding techniques. (2) Enhance readability through the use of indentation and blank lines. (3) Add comments to header files to help users of classes. (4) Add comments to implementation files to help maintainers of classes. (5) Create names that are meaningful and readable.

Hughes, Steven↗

Correct Compilation of Concurrent C Code

The CompCert compiler represents a landmark effort in program verification as both a piece of verified software and as a compiler for verified C programs. A key shortcoming of CompCert however is that it does not support multithreaded programs. Prior work to add threads to CompCert has either required major rewrites of parts of the proof or only works for well synchronized programs. The problem is that CompCert’s backward simulation derives from a forward simulation via the determinism of the semantics of intermediate representation languages. This makes the proofs in CompCert easier but also makes them incompatible with standard models of multithreading which are non-deterministic. Here we propose an alternate formulation of CompCert’s proof structure that parameterizes the existing single threaded semantics with nondeterministic behavior generated at the multithreading level. While this is an old trick where program equivalence is concerned, performing it in the context of CompCert is quite subtle. Our approach allows for expressive concurrent semantics and does not require major proof rewrites but still results in a global backward simulation for multithreaded programs.

97 MATHEMATICS AND COMPUTING↗

XML-Based Generator of C++ Code for Integration With GUIs

An open source computer program has been developed to satisfy a need for simplified organization of structured input data for scientific simulation programs. Typically, such input data are parsed in from a flat American Standard Code for Information Interchange (ASCII) text file into computational data structures. Also typically, when a graphical user interface (GUI) is used, there is a need to completely duplicate the input information while providing it to a user in a more structured form. Heretofore, the duplication of the input information has entailed duplication of software efforts and increases in susceptibility to software errors because of the concomitant need to maintain two independent input-handling mechanisms. The present program implements a method in which the input data for a simulation program are completely specified in an Extensible Markup Language (XML)-based text file. The key benefit for XML is storing input data in a structured manner. More importantly, XML allows not just storing of data but also describing what each of the data items are. That XML file contains information useful for rendering the data by other applications. It also then generates data structures in the C++ language that are to be used in the simulation program. In this method, all input data are specified in one place only, and it is easy to integrate the data structures into both the simulation program and the GUI. XML-to-C is useful in two ways: 1. As an executable, it generates the corresponding C++ classes and 2. As a library, it automatically fills the objects with the input data values.

Hua, Hook↗

On the undetected error probability of a concatenated coding scheme for error control

Consider a concatenated coding scheme for error control on a binary symmetric channel, called the inner channel. The bit error rate (BER) of the channel is correspondingly called the inner BER, and is denoted by Epsilon (sub i). Two linear block codes, C(sub f) and C(sub b), are used. The inner code C(sub f), called the frame code, is an (n,k) systematic binary block code with minimum distance, d(sub f). The frame code is designed to correct + or fewer errors and simultaneously detect gamma (gamma +) or fewer errors, where + + gamma + 1 = to or d(sub f). The outer code C(sub b) is either an (n(sub b), K(sub b)) binary block with a n(sub b) = mk, or an (n(sub b), k(Sub b) maximum distance separable (MDS) code with symbols from GF(q), where q = 2(b) and the code length n(sub b) satisfies n(sub)(b) = mk. The integerim is the number of frames. The outercode is designed for error detection only.

Deng, H.↗

Sidelobe reduction of Barker codes, part 7.1C

Barker codes can be realized as simple digital preprocessors, or with the use of a delay line, can be realized as an analogue device. Assuming the process observed has an autocorrelation time that is long compared to the code length, a gain in signal to noise, G = N where N is the number of elements in the code, may be realized. Typically Barker codes are implemented by shifting the phase of the transmitted signal by 0 or 180 degrees according to the code pattern. A typical detection scheme is shown where the output of the radar receiver is delayed by an analogue delay line or a shift register. The signal in each element of the delay line or shift register is continuously multiplied by the code and all elements are summed. A principal disadvantage was the sidelobe response. In the case of MST or ST radar echoes where there is a dynamic range as large as 60 dB, these unwanted sidelobes cause an increase in the apparent width of atmospheric layers, or some narrow layer to appear at several altitudes. The sidelobes of a Barker code may be reduced by tapering the response of the decoder. Optimum tapers, are shown. It is found that the sidelobe response is greatly reduced with very little loss in G.

Green, J. L.↗

Auto Code Generation for Simulink-Based Attitude Determination Control System

This paper details the work done to auto generate C code from a Simulink-Based Attitude Determination Control System (ADCS) to be used in target platforms. NASA Marshall Engineers have developed an ADCS Simulink simulation to be used as a component for the flight software of a satellite. This generated code can be used for carrying out Hardware in the loop testing of components for a satellite in a convenient manner with easily tunable parameters. Due to the nature of the embedded hardware components such as microcontrollers, this simulation code cannot be used directly, as it is, on the target platform and must first be converted into C code; this process is known as auto code generation. In order to generate C code from this simulation; it must be modified to follow specific standards set in place by the auto code generation process. Some of these modifications include changing certain simulation models into their atomic representations which can bring new complications into the simulation. The execution order of these models can change based on these modifications. Great care must be taken in order to maintain a working simulation that can also be used for auto code generation. After modifying the ADCS simulation for the auto code generation process, it is shown that the difference between the output data of the former and that of the latter is between acceptable bounds. Thus, it can be said that the process is a success since all the output requirements are met. Based on these results, it can be argued that this generated C code can be effectively used by any desired platform as long as it follows the specific memory requirements established in the Simulink Model.

MolinaFraticelli, Jose Carlos↗

Multi-level bandwidth efficient block modulation codes

The multilevel technique is investigated for combining block coding and modulation. There are four parts. In the first part, a formulation is presented for signal sets on which modulation codes are to be constructed. Distance measures on a signal set are defined and their properties are developed. In the second part, a general formulation is presented for multilevel modulation codes in terms of component codes with appropriate Euclidean distances. The distance properties, Euclidean weight distribution and linear structure of multilevel modulation codes are investigated. In the third part, several specific methods for constructing multilevel block modulation codes with interdependency among component codes are proposed. Given a multilevel block modulation code C with no interdependency among the binary component codes, the proposed methods give a multilevel block modulation code C which has the same rate as C, a minimum squared Euclidean distance not less than that of code C, a trellis diagram with the same number of states as that of C and a smaller number of nearest neighbor codewords than that of C. In the last part, error performance of block modulation codes is analyzed for an AWGN channel based on soft-decision maximum likelihood decoding. Error probabilities of some specific codes are evaluated based on their Euclidean weight distributions and simulation results.

Lin, Shu↗

Manuscript model outputs, model source code, and figure scripts: The role of geomorphology in mediating biomass allocation impacts on salt-marsh resilience and carbon accumulation

This data package provides model source code (C++), model outputs, and figure generation scripts (R) needed to reproduce the following manuscript: Bruns, Nicholas E., Genevieve L. Noyce, and Matthew L. Kirwan. "The Role of Geomorphology in Mediating Biomass Allocation Impacts on Salt-Marsh Resilience and Carbon Accumulation." Estuarine, Coastal and Shelf Science 327 (December 2025): 109549. https://doi.org/10.1016/j.ecss.2025.109549. This manuscript investigates how geomorphology mediates the impact of biomass allocation shifts on salt marsh persistence and carbon (C) sequestration under sea level rise. We use a 1-D soil-column model (Kirwan and Mudd 2012) to perform experiments across a range of static root:shoot ratios (RSR = 1-4) spanning observed values. The model explicitly simulates interactions between tidal inundation, productivity, inorganic sediment deposition, and organic matter accumulation. Experiments determine whether geomorphic feedbacks amplify, dampen, or leave unchanged the ecosystem response to biomass allocation shifts. A first experiment uses constant sea level rise (2.5 mm/yr) to examine equilibrium dynamics and their influence on carbon accumulation rates across different suspended sediment concentrations (SSC). A second set of experiments calculates threshold sea level rise rates for marsh drowning across RSR and SSC combinations. Final experiments apply accelerating sea level rise scenarios (2000-2200) derived from NOAA projections (Sweet et al. 2022) to generate an envelope of expected responses, quantifying the importance of biomass allocation shifts on marsh carbon accumulation and persistence. All experiments are repeated across SSC ranging from 5-50 mg/L to investigate how these interactions vary in micro-tidal marshes with different sediment supplies. Package contents: * README.txt with detailed description of package contents and instructions for reproducing manuscript figures and model outputs * R scripts for generating all manuscript figures * C++ baseline model code from Kirwan and Mudd (2012) * C++ source code for 4 experimental model variants used in the manuscript, extending above baseline code * Model input files (.csv, .txt) including sea level rise scenarios * Model output files (.txt) used in manuscript analyses Temporal coverage: Model simulations span years 1900-2200, with accelerating sea level rise scenarios for 2000-2200. Key variables: Root:shoot ratio, suspended sediment concentration, carbon accumulation rate, vertical accretion rate, marsh elevation, inundation depth, threshold sea level rise rate.

54 ENVIRONMENTAL SCIENCES↗

Agile Multi-Scale Decompositions for Automatic Image Registration

In recent works, the first and third authors developed an automatic image registration algorithm based on a multiscale hybrid image decomposition with anisotropic shearlets and isotropic wavelets. This prototype showed strong performance, improving robustness over registration with wavelets alone. However, this method imposed a strict hierarchy on the order in which shearlet and wavelet features were used in the registration process, and also involved an unintegrated mixture of MATLAB and C code. In this paper, we introduce a more agile model for generating features, in which a flexible and user-guided mix of shearlet and wavelet features are computed. Compared to the previous prototype, this method introduces a flexibility to the order in which shearlet and wavelet features are used in the registration process. Moreover, the present algorithm is now fully coded in C, making it more efficient and portable than the MATLAB and C prototype. We demonstrate the versatility and computational efficiency of this approach by performing registration experiments with the fully-integrated C algorithm. In particular, meaningful timing studies can now be performed, to give a concrete analysis of the computational costs of the flexible feature extraction. Examples of synthetically warped and real multi-modal images are analyzed.

Science Data Processing↗

Agile Multi-Scale Decompositions for Automatic Image Registration

In recent works, the first and third authors developed an automatic image registration algorithm based on a multiscale hybrid image decomposition with anisotropic shearlets and isotropic wavelets. This prototype showed strong performance, improving robustness over registration with wavelets alone. However, this method imposed a strict hierarchy on the order in which shearlet and wavelet features were used in the registration process, and also involved an unintegrated mixture of MATLAB and C code. In this paper, we introduce a more agile model for generating features, in which a flexible and user-guided mix of shearlet and wavelet features are computed. Compared to the previous prototype, this method introduces a flexibility to the order in which shearlet and wavelet features are used in the registration process. Moreover, the present algorithm is now fully coded in C, making it more efficient and portable than the MATLAB and C prototype. We demonstrate the versatility and computational efficiency of this approach by performing registration experiments with the fully-integrated C algorithm. In particular, meaningful timing studies can now be performed, to give a concrete analysis of the computational costs of the flexible feature extraction. Examples of synthetically warped and real multi-modal images are analyzed.

Science Data Processing↗