Skip to content

Commit

Permalink
Add new capabilities
Browse files Browse the repository at this point in the history
- module -T: fixed weibull distribution, made minor fixes.
- module -M: changed default value of -order to 2, changed -nset default value
  to faces,edges,vertices in 3D and edges,vertices in 2D, fixed msh4 format,
  fixed meshing of -transform cut(cylinder) tessellations.
- module -V: fixed -datanodecoofact.
- module -S: changed simulation.config onto simulation.cfg.
- documentation: made minor fix.
- general: cleaned tests.
  • Loading branch information
rquey committed Jan 9, 2024
1 parent 075c24f commit 00e812c
Show file tree
Hide file tree
Showing 185 changed files with 18,299 additions and 3,633 deletions.
10 changes: 7 additions & 3 deletions VERSIONS
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
New in 4.7.1-17 (21 Dec 2023):
New in 4.8.0 (09 Jan 2024):
- module -T: fixed weibull distribution, made minor fixes.
- module -M: fixed meshing of -transform cut(cylinder) tessellations,
fixed msh4 format.
- module -M: changed default value of -order to 2, changed -nset default value
to faces,edges,vertices in 3D and edges,vertices in 2D, fixed msh4 format,
fixed meshing of -transform cut(cylinder) tessellations.
- module -V: fixed -datanodecoofact.
- module -S: changed simulation.config onto simulation.cfg.
- documentation: made minor fix.
- general: cleaned tests.

* Incompatible changes: In -M, changed default value of -order to 2.

New in 4.7.0 (17 Nov 2023):
- module -T: added -ori odf, added -orisampling, improved -domain rodrigues,
added -statcell scale and voxnb, fixed -morpho cube, fixed -transform rmsat,
Expand Down
4 changes: 2 additions & 2 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import sphinx_rtd_theme

project = u'Neper'
version = u'4.7.1-17'
release = u'4.7.1-17'
version = u'4.8.0'
release = u'4.8.0'
author = u'Romain Quey'
copyright = u'Romain Quey'
language = 'en'
Expand Down
2 changes: 1 addition & 1 deletion doc/fileformat.rst
Original file line number Diff line number Diff line change
Expand Up @@ -718,7 +718,7 @@ Here are details on the :file:`.sim` simulation directory (the :file:`.sim` exte
simulation.sim
|-- inputs
|   |-- job.sh
|   |-- simulation.config
|   |-- simulation.cfg
|   |-- simulation.msh
|   `-- simulation.tess
`-- results
Expand Down
10 changes: 5 additions & 5 deletions doc/neper_m.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ For mapped meshing, mesh cleaning options enable the removal of isolated element

Mesh partitioning allows for the division the mesh nodes and elements into several sets while minimizing the interfaces between them [#partitioning]_, as needed for parallel simulations with FEPX. Partitioning can return any number of partitions or be done according to a given parallel computer architecture (options :data:`-part*`).

In the output mesh, the individual entities of the tessellations (the vertices, edges, faces and polyhedra) can be described by element sets (option :option:`-dim`). Node sets of the vertices, edges and faces located on the boundary of the tessellation are also provided for prescribing the boundary conditions (option :option:`-nset`). The surface element sets are also provided (option :option:`-faset`). Element sets other than those corresponding to the tessellation cells can be defined (option :option:`-elset`). The mesh order can be 1 or 2 (option :option:`-order`). Statistical data can be obtained on the meshes (options :data:`-stat*`).
In the output mesh, the individual entities of the tessellations (the vertices, edges, faces and polyhedra) can be described by element sets (option :option:`-dim`). Node sets of the vertices, edges and faces located on the boundary of the tessellation are also provided for prescribing the boundary conditions (option :option:`-nset`). The surface element sets are also provided (option :option:`-faset`). Element sets other than those corresponding to the tessellation cells can be defined (option :option:`-elset`). The mesh order can be 1 or 2 (option :option:`-order`, default :data:`2`). Statistical data can be obtained on the meshes (options :data:`-stat*`).

The methods implemented for meshing are described in [CMAME2011]_.

Expand Down Expand Up @@ -196,7 +196,7 @@ Meshing Options

- :data:`2`: quadratic-interpolation elements (3-node linear elements, 6-node triangular elements, 8-node or 9-node quadrangular elements, 10-node tetrahedral elements and 20-node hexahedral elements).

**Default value**: :data:`1`.
**Default value**: :data:`2`.

.. option:: -cl{ver,edge,face} or -rcl{ver,edge,face} <characteritic_length> (secondary options

Expand Down Expand Up @@ -482,7 +482,7 @@ Output Options

- :data:`none`: none.

**Default value**: :data:`faces` in 3D and :data:`edges` in 2D.
**Default value**: :data:`faces,edges,vertices` in 3D and :data:`edges,vertices` in 2D.

.. option:: -faset <faset1>,<faset2>,...

Expand Down Expand Up @@ -652,11 +652,11 @@ Below are some examples of use of neper -M.
$ neper -M n100-id1.tesr
- Mesh tessellation :file:`n100-id1.tess` with a mesh size of rcl = 0.5 and in 2nd-order elements:
- Mesh tessellation :file:`n100-id1.tess` with a mesh size of rcl = 0.5 and in 1st-order elements:

.. code-block:: console
$ neper -M n100-id1.tess -rcl 0.5 -order 2
$ neper -M n100-id1.tess -rcl 0.5
- Mesh tessellation :file:`n100-id1.tess` with small elements for the interior cells and bigger elements for the boundary cells:

Expand Down
60 changes: 23 additions & 37 deletions doc/neper_s.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,8 @@ Simulation Module (-S)

Module -S is the module for post-processing simulation results. It generates and works on a simply-structured and human-friendly :ref:`simulation_directory`. The :ref:`simulation_directory` is particularly well suited for result management and allows for the computation of new results.

A :ref:`simulation_directory` is typically generated from an FEPX raw result directory, which can be done as simply as follows:

.. code-block:: console
$ neper -S <fepx_raw_result_directory>
A :ref:`simulation_directory` can also be generated by the :ref:`neper_t` or the :ref:`neper_m` (option :data:`-format sim`), in which case it contains the (raster) tessellation or mesh file but no simulation results --- the various post-processing capabilities of :ref:`neper_s` can then be used on the (raster) tessellation or mesh. Finally, simulation directories that represent successive parts of a simulation (e.g. resulting from FEPX restarts) can be merged into a single one.
A :ref:`simulation_directory` is typically generated by FEPX.
It can also be generated by the :ref:`neper_t` or the :ref:`neper_m` (option :data:`-format sim`), in which case it contains the (raster) tessellation or mesh file but no simulation results --- the various post-processing capabilities of :ref:`neper_s` can then be used on the (raster) tessellation or mesh. Finally, simulation directories that represent successive parts of a simulation (e.g. resulting from FEPX restarts) can be merged into a single one.

New results can be computed for several *entities* of the (raster) tessellation and mesh, including the (raster) tessellation cells and the mesh nodes, elements and elsets. The whole (raster) tessellation and mesh can also serve as *entities*. New *entities* corresponding to sets of elements can also be defined.

Expand All @@ -26,48 +21,40 @@ Here is what a typical run of module -S looks like:

.. code-block:: console
$ neper -S fepx-simulation
$ neper -S simulation.sim -reselset stress
======================== N e p e r =======================
Info : A software package for polycrystal generation and meshing.
Info : Version 4.0.0
Info : Version 4.8.0
Info : Built with: gsl|muparser|opengjk|openmp|nlopt|libscotch (full)
Info : Running on 8 threads.
Info : Running on 20 threads.
Info : <https://neper.info>
Info : Copyright (C) 2003-2021, and GNU GPL'd, by Romain Quey.
Info : Copyright (C) 2003-2022, and GNU GPL'd, by Romain Quey.
Info : Loading initialization file `/home/rquey/.neperrc'...
Info : ---------------------------------------------------------------
Info : MODULE -S loaded with arguments:
Info : [ini file] (none)
Info : [com line] fepx-simulation
Info : [com line] simulation.sim -reselset stress
Info : ---------------------------------------------------------------
Info : Reading input data...
Info : - Reading arguments...
Info : Writing simulation directory from FEPX result directory...
Info : [o] Writing directory `fepx-simulation.sim'...
Info : - Parsing FEPX results...
Info : [i] Parsing file `fepx-simulation/post.report'...
Info : [i] Parsed file `fepx-simulation/post.report'.
Info : > Partition number: 8.
Info : > Step number: 10.
Info : > Node number: 2752.
Info : > Element number: 1596.
Info : - Writing report file...
Info : [o] Writing file `fepx-simulation.sim/report'...
Info : [o] Wrote file `fepx-simulation.sim/report'.
Info : - Writing inputs...
Info : [o] Writing directory `fepx-simulation.sim/inputs'...
Info : . simulation.tess...
Info : . simulation.msh...
Info : . simulation.config...
Info : [o] Wrote directory `fepx-simulation.sim/inputs'.
Info : > Input files: msh config
Info : > Node number : 49
Info : > Element number : 16
Info : > Elset number : 2
Info : > Partition number : 2
Info : > Step number : 2
Info : > Node results : coo disp vel
Info : > Elt results : ori stress
Info : Running post-processing...
Info : - Loading inputs...
Info : > simulation.msh...
Info : > simulation.cfg...
Info : - Writing results...
Info : [o] Writing directory `fepx-simulation.sim/results'...
Info : . coo... 100%
Info : . ori... 100%
Info : [o] Wrote directory `fepx-simulation.sim/results'.
Info : [o] Wrote directory `fepx-simulation.sim'.
Info : Elapsed time: 0.075 secs.
Info : [o] Writing directory `simulation.sim/results/elsets'...
Info : . stress ........................................... 100%
Info : [o] Wrote directory `simulation.sim/results/elsets'.
Info : Elapsed time: 0.010 secs.
========================================================================
Arguments
Expand All @@ -80,7 +67,6 @@ Input Data

Specify the name of the input directory, which can be:

- an FEPX raw result directory [#f1]_ (to convert into a :ref:`simulation_directory`);
- a :ref:`simulation_directory`;
- a series of simulation directories combined with :data:`,` (to merge).

Expand Down
Binary file removed doc/tutorials/orientation_trajectories/n20.sim.tgz
Binary file not shown.
4 changes: 2 additions & 2 deletions doc/tutorials/orientation_trajectories/n20.sim/.sim
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
simulation.tesr
*msh
simulation.msh
*config
simulation.config
*cfg
simulation.cfg
**general
0 3606 2201 20 2
*orides
Expand Down
2 changes: 1 addition & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if(POLICY CMP0077)
cmake_policy(SET CMP0077 NEW)
endif()

set(NEPER_VERSION \"4.7.1-17\")
set(NEPER_VERSION \"4.8.0\")
project(neper)

if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)
Expand Down
2 changes: 1 addition & 1 deletion src/neper_m/nem_input/nem_input3.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ nem_input_options_default (struct IN_M *pIn)
strcpy ((*pIn).format, "msh");

/* Options for meshing ------------------------------- */
(*pIn).order = 1;
(*pIn).order = 2;
(*pIn).dimstring = ut_alloc_1d_char (9);
strcpy ((*pIn).dimstring, "inputdim");

Expand Down
8 changes: 8 additions & 0 deletions src/neper_m/nem_writemesh/nem_writemesh1.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,14 @@ nem_writemesh (struct IN_M In, struct TESS Tess, struct NODES Nodes,
strcpy (sizestring[2], "area");
strcpy (sizestring[3], "volume");

if (!strcmp (In.nset, "default"))
{
if (dim == 3)
ut_string_string ("faces,edges,vertices", &(In.nset));
else if (dim == 2)
ut_string_string ("edges,vertices", &(In.nset));
}

neut_nset_expand (NSet[0], NSet[1], NSet[2], In.nset, &nsetlist);
if (!strcmp (Mesh[dim].EltType, "tri"))
neut_nset_expand (NSet[0], NSet[1], NSet[2], In.faset, &fasetlist);
Expand Down
2 changes: 2 additions & 0 deletions src/neper_s/nes_convert/nes_convert1.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ nes_convert (struct IN_S In, struct SIM *pSim)
{
struct FEPXSIM FSim;

ut_print_message (1, 2, "Conversion will be removed in a future version.\n");

neut_fepxsim_set_zero (&FSim);

nes_convert_parse (In, &FSim, pSim);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ nes_convert_write_inputs (struct IN_S In, struct FEPXSIM *pFSim)
ut_string_string ((*pFSim).msh, filename + filenameqty - 1);
}

if ((*pFSim).config)
if ((*pFSim).cfg)
{
filename = ut_realloc_1d_pchar_null (filename, ++filenameqty, 1);
ut_string_string ((*pFSim).config, filename + filenameqty - 1);
ut_string_string ((*pFSim).cfg, filename + filenameqty - 1);
}

// *.sh
Expand Down
2 changes: 1 addition & 1 deletion src/neper_s/nes_pproc/nes_pproc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ nes_pproc_load (struct SIM *pSim, struct TESS *pTess, struct TESR *pTesr,
if ((*pSim).msh)
nes_loadmesh (pSim, pNodes, Mesh, 2);

if ((*pSim).config)
if ((*pSim).cfg)
nes_loadconfig (*pSim, &GroupCrySym, &GroupQty, 2);

neut_sim_testinputs (*pSim, *pTess, Mesh);
Expand Down
4 changes: 2 additions & 2 deletions src/neper_s/nes_pproc/nes_pproc3.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "nes_pproc_.h"

// Checking consistency between Tess and Sim crysym, if simulation.config exists
// Checking consistency between Tess and Sim crysym, if simulation.cfg exists
void
nes_pproc_load_crysym (struct TESS *pTess, struct TESR *pTesr,
struct NODES *pNodes, struct MESH *Mesh,
Expand All @@ -14,7 +14,7 @@ nes_pproc_load_crysym (struct TESS *pTess, struct TESR *pTesr,

if (GroupQty)
{
// Does simulation.config have multiple crystal symmetries?
// Does simulation.cfg have multiple crystal symmetries?
multiple = 0;
for (i = 1; i < GroupQty; i++)
if (strcmp (GroupCrySym[0], GroupCrySym[i]))
Expand Down
6 changes: 3 additions & 3 deletions src/neper_s/nes_utils/nes_utils1.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ void
nes_loadconfig (struct SIM Sim, char ***pGroupCrySym, int *pGroupQty, int verbosity)
{
int id;
char *filename = ut_string_paste3 (Sim.simdir, "/inputs/", Sim.config);
char *filename = ut_string_paste3 (Sim.simdir, "/inputs/", Sim.cfg);
char *string = ut_alloc_1d_char (1000);
FILE *fp = NULL;

if (Sim.config && ut_file_exist (filename))
if (Sim.cfg && ut_file_exist (filename))
{
if (verbosity)
ut_print_message (0, verbosity + 1, "%s...\n", Sim.config);
ut_print_message (0, verbosity + 1, "%s...\n", Sim.cfg);

fp = ut_file_open (filename, "R");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,11 @@ neut_fepxsim_fscanf (char *dir, struct FEPXSIM *pFSim, char *mode)
ut_string_string ("simulation.tesr", &(*pFSim).tesr);
if (ut_file_exist ("%s/simulation.msh", (*pFSim).fepxdir))
ut_string_string ("simulation.msh", &(*pFSim).msh);
if (ut_file_exist ("%s/simulation.config", (*pFSim).fepxdir))
ut_string_string ("simulation.config", &(*pFSim).config);

if (ut_file_exist ("%s/simulation.cfg", (*pFSim).fepxdir))
ut_string_string ("simulation.cfg", &(*pFSim).cfg);
else if (ut_file_exist ("%s/simulation.config", (*pFSim).fepxdir))
ut_string_string ("simulation.config", &(*pFSim).cfg);

file = ut_file_open (filename, mode);

Expand Down Expand Up @@ -155,7 +158,7 @@ neut_fepxsim_fscanf (char *dir, struct FEPXSIM *pFSim, char *mode)

ut_free_1d_char (&filename);

filename = ut_string_paste3 (name, "/", (*pFSim).config);
filename = ut_string_paste3 (name, "/", (*pFSim).cfg);

file = ut_file_open (filename, "R");
while (fscanf (file, "%s", tmp) == 1)
Expand Down
4 changes: 2 additions & 2 deletions src/neut/neut_fepxsim/neut_fepxsim_op/neut_fepxsim_op.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ neut_fepxsim_set_zero (struct FEPXSIM *pFSim)
(*pFSim).bcs = NULL;
(*pFSim).ori = NULL;
(*pFSim).phase = NULL;
(*pFSim).config = NULL;
(*pFSim).cfg = NULL;

return;
}
Expand All @@ -47,7 +47,7 @@ neut_fepxsim_free (struct FEPXSIM *pFSim)
ut_free_1d_char (&(*pFSim).bcs);
ut_free_1d_char (&(*pFSim).ori);
ut_free_1d_char (&(*pFSim).phase);
ut_free_1d_char (&(*pFSim).config);
ut_free_1d_char (&(*pFSim).cfg);

ut_free_1d_int (&(*pFSim).PartNodeQty);
ut_free_1d_int (&(*pFSim).PartEltQty);
Expand Down
2 changes: 1 addition & 1 deletion src/neut/neut_fepxsim/neut_fepxsim_sim/neut_fepxsim_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ neut_fepxsim_sim (struct FEPXSIM FSim, struct SIM *pSim)
ut_string_string (FSim.bcs, &(*pSim).bcs);
ut_string_string (FSim.ori, &(*pSim).ori);
ut_string_string (FSim.phase, &(*pSim).phase);
ut_string_string (FSim.config, &(*pSim).config);
ut_string_string (FSim.cfg, &(*pSim).cfg);

(*pSim).RestartId = FSim.RestartId;
(*pSim).RestartFiles = FSim.RestartFiles;
Expand Down
14 changes: 0 additions & 14 deletions src/neut/neut_nset/neut_nset.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,6 @@ neut_nset_expand (struct NSET NSet0D, struct NSET NSet1D, struct NSET NSet2D,
if (!in || strlen (in) == 0 || !strcmp (in, "none"))
return;

if (strstr (in, "default"))
{
qty = 1;
list = ut_alloc_2d_char (qty, 11);
if (NSet2D.qty > 0)
strcpy (list[0], "faces");
else if (NSet1D.qty > 0)
strcpy (list[0], "edges");
else if (NSet0D.qty > 0)
strcpy (list[0], "vertices");
else
ut_print_neperbug ();
}

else if (strstr (in, "all"))
{
if (NSet2D.qty > 0)
Expand Down
12 changes: 6 additions & 6 deletions src/neut/neut_sim/neut_sim_fprintf/neut_sim_fprintf1.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ neut_sim_fprintf (char *dir, struct SIM Sim, char *mode)
fprintf (file, " *ori\n %s\n", Sim.msh);
if (Sim.phase)
fprintf (file, " *phase\n %s\n", Sim.msh);
if (Sim.config)
fprintf (file, " *config\n %s\n", Sim.config);
if (Sim.cfg)
fprintf (file, " *cfg\n %s\n", Sim.cfg);

fprintf (file, " **general\n");
fprintf (file, " %d %d %d %d %d\n",
Expand Down Expand Up @@ -267,8 +267,8 @@ neut_sim_fprintf_asy (char *dir, struct SIM Sim, char *mode)
fprintf (file, "TreeNode child1%d = makeNode(child1, \"\\tt %s\");\n", ++id, Sim.ori);
if (Sim.phase)
fprintf (file, "TreeNode child1%d = makeNode(child1, \"\\tt %s\");\n", ++id, Sim.phase);
if (Sim.config)
fprintf (file, "TreeNode child1%d = makeNode(child1, \"\\tt %s\");\n", ++id, Sim.config);
if (Sim.cfg)
fprintf (file, "TreeNode child1%d = makeNode(child1, \"\\tt %s\");\n", ++id, Sim.cfg);

int print_results = 0;
char *child1 = ut_alloc_1d_char (100);
Expand Down Expand Up @@ -343,8 +343,8 @@ neut_sim_verbose (struct SIM Sim)
printf (" ori");
if (Sim.phase)
printf (" phase");
if (Sim.config)
printf (" config");
if (Sim.cfg)
printf (" cfg");
printf ("\n");

if (Sim.RestartId || Sim.RestartFiles)
Expand Down
Loading

0 comments on commit 00e812c

Please sign in to comment.