Meshes with different element topologies in gmsh (for Code-Aster)
We have been translating a few Code-Aster verification test manuals into English. The process is not just a straightforward translation of the text in the Fr...
In my previous post on reading XML input files, I discussed how input files can be made more human friendly with XML markup. In some situations, it may be preferable to have JSON format files instead.
JSON is particularly useful when the Javascript is used during reading and writing. Though Javascript is not the ideal platform for computational engineering, it has some potential is used for user interface development.
Note: It remains to be seen how useful Javascript user interfaces are when used for engineering applications, though cross-platform tools such as Electron has potential. User interfaces designed with wxWidgets or Qt still dominate the landscape for engineering software.
In JSON format, our Boundary
input file can be expressed as:
Recall that the equivalent XML input file has the form
I prefer the XML version, but most new students will be familiar with JSON and may prefer that format, particularly as that format appears to be preferred in IoT applications.
A large list of JSON readers for C++ can be found in the JSON webdocs. A reasonably good header-only library is JSON for Modern C++. I have chosen to use that library because its constructs are similar to those of ZenXml.
We add a new method, readJSON
, to the class BoundaryReader
and
implement it as follows.
I’m not really a fan of try-catch
blocks, but that’s the easiest way of dealing cleanly with read/parse failures when using JSON for Modern C++
. For research codes, this approach will suffice. An alternative is to use a check of the form
Sometimes input/output files for engineering simulations can be quite large. In those situations I would suggest XML with binary data. In future post I’ll show you how to create a VTK XML format output file with binary data.
If you have questions/comments/corrections, please contact banerjee at parresianz dot com dot json (without the dot json).
We have been translating a few Code-Aster verification test manuals into English. The process is not just a straightforward translation of the text in the Fr...
The Code-Aster cooling tower modal analysis validation test FORMA11c comes with a quadrilateral mesh provided by Code-Aster. Tips on quadrilateral meshing wi...
In this article, I will discuss how elements can be selected from deep inside a 3D mesh in the Salome-Meca environment and manipulated with Python scripts.
Introduction One of the reasons I switched to cmake for my builds was the need to compile my Vaango code on a BlueGene/Q system. The code was previously co...
Introduction In this article we take a short detour into the problem of continuous unit testing of code that contains MPI calls and use either mpich or Open ...
Introduction The Plimpton scheme of communicating ghost information between patches was described in Part 3 of this series. Let us now see how a similar appr...
Introduction In Part 2 of this series we showed the direct way of communicating ghost particles between patches. That approach requires 26 communication ste...
Introduction The previous article in this series discussed the scatter operation for moving particles to various processes. In this second part of the serie...
Introduction For parallel particle codes that have to be written quickly (while retaining flexibility), the task-based parallelism approach doesn’t always wo...
Introduction On July 7, 2017, the Project Midas group released a couple of plots of material velocities and interferograms showing the evolution of a large r...
Introduction Several years ago I took created a Wikpedia article on objective stress rates based on lecture notes in nonlinear finite elements for a class th...
Introduction I developed the ARENA model for partially saturated soils last year (2016). Before that we had tried using a typical Drucker-Prager with cap mo...
The question A colleague asked a question on objectivity a few days ago that had me going back to Ray Ogden’s book on nonlinear elastic deformations. The qu...
Introduction Recently, I came across a question in StackExchange that pointed out that some books on continuum mechanics suggest that an element will increas...
Introduction In Part 3 of this article I discussed the approach where the equations for a system of rigid bodies are approximated by a spring-mass system. T...
Introduction In Part 1 of this article, we revisited the CFL condition and in Part 2 we showed how the CFL condition and the von Neumann stability condition ...
Introduction In the first part of this article, we looked at the one-dimensional linear second-order wave equation
Introduction Solutions of hyperbolic partial differential equations using explicit numerical methods need a means of limiting the timestep so that the solu...
Introduction We saw how to create an XML file containing compressed particle data in the article “XML format for particle input files”. Let us now explore ho...
Introduction In Part 8 of the series on return algorithms for plasticity we animated the closest-point return algorithm as shown below.
Introduction In Part 7, we saw that for isotropic elastic materials and perfect associated plasticity, the trial stress and the actual stress are at the shor...
Introduction In Part 6, I explained why a backward Euler stress update and a closest point return from the trial stress to the yield surface are closely rela...
Introduction In Part 5 I briefly hinted at the closest-point return algorithm. The ideas behind this were made rigorous in the mid-to-late 1980s by a group ...
Introduction One of the main points of divergence of many implementations of plastic return algorithms is the choice of the algorithm used for numerical inte...
Introduction In Part 2 of this series, we saw that a forward Euler return algorithm leads to the discretized equations
Introduction The previous parts of this series dealt with: Part 1: Background of 3D and plane stress Drucker-Prager plasticity Part 2: A forward Euler ...
Introduction In the previous part of this discussion, I derived plane stress expressions for linear elasticity, the Drucker-Prager yield function, and the as...
Introduction Recently I’ve encountered questions on how the radial return algorithm works when applied to plane stress plasticity. There seems to be some co...
Introduction Let us now change tack slightly and return to an issue I had talked about earlier in Input files: reading XML. Typical input files in research ...
Introduction In the previous articles in this series we talked about: Part 1: Reading VTK format particles with Javascript in a browser Part 2: Saving ...
Introduction In the previous articles in this series we talked about:
Introduction In the previous articles in this series we talked about: Part 1: Reading VTK format particles with Javascript in a browser Part 2: Saving ...
Introduction The previous articles in this series were about: Part 1: Reading VTK format particles with Javascript in a browser Part 2: Saving the read...
Introduction In Part 2 of this series, we showed how the particle data are saved into a Vuex store. Now we are ready to visualize the data. In this article...
Introduction In the first part of this series on scientific visualization in Javascript, we saw how data in VTK unstructured grid format produced by C++ simu...
In our previous article we discussed the process of calling XML functions in C++ to write data produced by particle simulations in XML format files. These o...
In my previous post on writing VTK output files I described how mesh data can be output in VTK XML format. In this article I will talk about how I output par...
I visualize the output of my simulations using either LLNL’s Visit or Kitware’s ParaView. These tools are wonderful for dealing with large datasets and can ...
In my previous post on reading XML input files, I discussed how input files can be made more human friendly with XML markup. In some situations, it may be p...
Mechanics research codes are typically written by graduate students who aim to get their work done as quickly as possible. These codes are not meant to las...
A few days ago I had to refactor a 20,000 line class that was being used as a regression tester for discrete element and peridynamics simulations. After som...
The Clang static analyzer tools come with a handy interface called clang-tidy.
Every once in a while I need to recall how clang-format is set up and run on my Ubuntu 16.04 machine. This post is meant to act as a reminder.
Recall that we had found a set of points that samples a cylindrical domain uniformly. However, these points do not match the locations of our sensors and we...
The amount of data is large. Before we analyze the whole set of data, we can find trends by examining a smaller set of sensors. A smaller set is also usef...