Skip to content

Commit 7ad17ee

Browse files
committed
Add new capabilities
- module -T: added -per 1 for -morpho cube, added -ori ks (Kurdjumov-Sachs) and ti_beta2alpha (titanium). - module -S: fixed -res* odfn. - module -V: added -data{elt2d,elset2d}trs, added -step final, fixed -show* <result_component>, added -showmeshsliceelt1d.
1 parent 8b58d75 commit 7ad17ee

File tree

48 files changed

+12252
-316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+12252
-316
lines changed

VERSIONS

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
1-
New in 4.8.3-6 (15 May 2024):
2-
- module -V: added -showmeshsliceelt1d.
1+
New in 4.9.0 (15 May 2024):
2+
- module -T: added -per 1 for -morpho cube, added -ori ks (Kurdjumov-Sachs)
3+
and ti_beta2alpha (titanium).
4+
- module -S: fixed -res* odfn.
5+
- module -V: added -data{elt2d,elset2d}trs, added -step final, fixed -show*
6+
<result_component>, added -showmeshsliceelt1d.
37

48
New in 4.8.2 (27 Mar 2024):
59
- module -T: added -transform "cut(cube)", added -morphooptiini ori and id,

doc/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
import sphinx_rtd_theme
1212

1313
project = u'Neper'
14-
version = u'4.8.3-6'
15-
release = u'4.8.3-6'
14+
version = u'4.9.0'
15+
release = u'4.9.0'
1616
author = u'Romain Quey'
1717
copyright = u'Romain Quey'
1818
language = 'en'

doc/neper_t.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ These options can be used to set the cell morphology.
282282

283283
- :data:`<ori_definition>` can be:
284284

285-
- :data:`file(<file_name>[,des=<descriptor>])`: discrete orientations to be read from a :ref:`data_file` written using a specific descriptor (see :ref:`rotations_and_orientations`, default :data:`rodrigues`).
285+
- :data:`file(<file_name>[,des=<descriptor>])`: discrete orientations to be read from a :ref:`data_file` written using a specific descriptor (see :ref:`rotations_and_orientations`, default :data:`rodrigues`). :option:`-ori` :data:`from_morpho` must also be used.
286286

287287
- :data:`<id_definition>` can be:
288288

@@ -491,6 +491,10 @@ Crystal Orientation Options
491491

492492
- :data:`parent[:<distribution>]`: orientations inherited from the ones of the parent cells, with an optional continuous distribution about the nominal orientations (see below);
493493

494+
- :data:`ks[:<distribution>]`: orientations inherited from the ones of the parent cells using the Kurdjumov-Sachs (KS) orientation relationship (austenite--ferrite transformation), with an optional continuous distribution about the nominal orientations (see below);
495+
496+
- :data:`ti_beta2alpha[:<distribution>]`: orientations inherited from the ones of the parent cells using the :math:`\beta\rightarrow\alpha` transformation orientation relationship in titanium, with an optional continuous distribution about the nominal orientations (see below);
497+
494498
- :data:`file(<file_name>[,des=<descriptor>])`: discrete orientations to be read from a :ref:`data_file` written using a specific descriptor (see :ref:`rotations_and_orientations`, default :data:`rodrigues`).
495499

496500
- :data:`from_morpho`: discrete orientations read from :option:`-morphooptiini`:data:`ori`.

doc/neper_v.rst

+14-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,8 @@ When a simulation directory is loaded as input, it is possible to specify the si
124124

125125
Specify the simulation step(s), which can be:
126126

127-
- :data:`0`: initial state;
127+
- :data:`0`: the initial state;
128+
- :data:`final`: the final step;
128129
- any step number;
129130
- :data:`all`: all steps;
130131
- a list of steps combined with :data:`,`; a range of values can also be specified using :data:`-`. An example is :data:`0-10,20` (for steps 0 to 10, and 20).
@@ -424,6 +425,18 @@ The following options enable the definition of the properties (color, size, etc.
424425

425426
**Default value**: :data:`palette` for integer values, :data:`viridis` for real values, and :data:`rodrigues` for crystal orientations.
426427

428+
.. index::
429+
single: -dataelt2dtrs
430+
single: -dataelset2dtrs
431+
432+
.. option:: -data{elt2d,elset2d}trs <transparency>
433+
434+
Specify the transparencies (values from 0 to 1), which can be:
435+
436+
- a real value;
437+
- an expression based on the variables described in :ref:`mesh_keys`, such as :data:`x` or :data:`area`;
438+
- :data:`file(<file_name>)`: individual values to load from a :ref:`data_file`.
439+
427440
.. option:: -data{elt,elset,node,elt{0-3}d,elset{0-3}d}scale <scale>
428441

429442
Specify the scale relative to the :data:`-data...col real` data, which can be:

src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ if(POLICY CMP0077)
77
cmake_policy(SET CMP0077 NEW)
88
endif()
99

10-
set(NEPER_VERSION \"4.8.3-6\")
10+
set(NEPER_VERSION \"4.9.0\")
1111
project(neper)
1212

1313
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 4.8.1)

src/neper_t/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ add_library(neper_t
7070
./net_tess/net_tess2.c
7171
./net_tess/net_tess_cube/net_tess_cube1.c
7272
./net_tess/net_tess_cube/net_tess_cube2.c
73+
./net_tess/net_tess_cube/net_tess_cube3.c
7374
./net_tess/net_tess_onecell/net_tess_onecell1.c
7475
./net_tess/net_tess_lam/net_tess_lam1.c
7576
./net_tess/net_tess_lam//net_tess_lam_seed/net_tess_lam_seed1.c

src/neper_t/net_flatten/net_flatten1.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@ net_flatten (struct MTESS MTess, struct TESS *Tess, struct TESS *pFTess)
2929
net_mtess_flatten (MTess, Tess2, id, Tess2 + id);
3030
}
3131

32-
3332
neut_tess_tess (Tess2[1], pFTess);
3433

35-
if (Tess[1].CellCrySym)
36-
ut_string_string (Tess[1].CellCrySym, &(*pFTess).CellCrySym);
34+
if (Tess[MTess.TessQty].CellCrySym)
35+
ut_string_string (Tess[MTess.TessQty].CellCrySym, &(*pFTess).CellCrySym);
3736

3837
(*pFTess).ScaleQty = MTess.LevelQty;
3938
(*pFTess).ScaleCellId =

src/neper_t/net_ori/net_ori1.c

+9
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,15 @@ net_ori (struct IN_T In, int level, struct MTESS MTess, struct TESS *Tess,
101101
else if (!strncmp (parts[i], "odf", 3))
102102
net_ori_odf ((*pSSet).Random, parts[i], OSets + i);
103103

104+
else if (!strncmp (parts[i], "parent", 6))
105+
net_ori_parent (parts[i], SSet, dtess, dcell, OSets + i);
106+
107+
else if (!strncmp (parts[i], "ks", 2) || !strncmp (parts[i], "KS", 2))
108+
net_ori_ks ((*pSSet).Random, parts[i], SSet, dtess, dcell, OSets + i);
109+
110+
else if (!strcmp (parts[i], "ti_beta2alpha"))
111+
net_ori_ti_beta2alpha ((*pSSet).Random, parts[i], SSet, dtess, dcell, OSets + i);
112+
104113
else
105114
net_ori_label (parts[i], SSet, dtess, dcell, OSets + i);
106115

src/neper_t/net_ori/net_ori2.c

+169-14
Original file line numberDiff line numberDiff line change
@@ -92,39 +92,194 @@ net_ori_fiber (struct SEEDSET *SSet, int dtess, int dcell, long random,
9292
}
9393

9494
void
95-
net_ori_label (char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet)
95+
net_ori_ks (long random, char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet)
9696
{
9797
unsigned int i;
98-
int status, partqty;
98+
int partqty;
9999
double *q = ol_q_alloc ();
100100
char **parts = NULL;
101-
char *spread = NULL;
101+
int status_parent, status_child;
102+
double **X = ol_g_alloc ();
103+
int n1;
104+
double alpha_over_phi = 1.; // pow (2, 1. / 3);
105+
double phi_over_alpha = 1. / alpha_over_phi;
106+
double d = sqrt (6) * pow (phi_over_alpha, 3);
107+
double *qX = ol_q_alloc ();
108+
double *qtmp = ol_q_alloc ();
109+
gsl_rng *r = NULL;
102110

103111
ut_list_break (label, NEUT_SEP_DEP, &parts, &partqty);
104112

113+
// After (Fortes, 1984)
114+
if (strcmp (parts[0], "ks") && strcmp (parts[0], "KS"))
115+
abort ();
116+
117+
// Checking crystal symmetries
118+
status_parent = 0; // 1: warning, 2: error
119+
status_child = 0; // 1: warning, 2: error
120+
if (strcmp (SSet[dtess].crysym, "cubic") || strcmp ((*pOSet).crysym, "cubic"))
121+
{
122+
if (strcmp (SSet[dtess].crysym, "cubic"))
123+
status_parent = (!strcmp (SSet[dtess].crysym, "triclinic")) ? 1 : 2;
124+
125+
if (strcmp ((*pOSet).crysym, "cubic"))
126+
status_child = (!strcmp (SSet[dtess].crysym, "triclinic")) ? 1 : 2;
127+
}
128+
129+
if (ut_num_max (status_parent, status_child) == 1)
130+
ut_print_message (1, 2, "KS transformation assumes cubic parent and child phases.\n");
131+
else if (ut_num_max (status_parent, status_child) == 2)
132+
ut_print_message (2, 2, "KS transformation requires cubic parent and child phases.\n");
133+
134+
ut_array_1d_set_3 (X[0], 2 * d + 1, -1, d - 2);
135+
ut_array_1d_set_3 (X[1], 1, 2 * d - 1, -d - 2);
136+
ut_array_1d_set_3 (X[2], d - 2, d + 2, 4);
137+
ut_array_2d_scale (X, 3, 3, 1. / pow (6 * d, 2. / 3));
138+
139+
ol_g_q (X, qX);
140+
141+
r = gsl_rng_alloc (gsl_rng_ranlxd2);
142+
gsl_rng_set (r, random - 1);
143+
144+
ut_print_message (0, 2, "Applying KS...\n");
145+
146+
for (i = 0; i < (*pOSet).size; i++)
147+
{
148+
n1 = 1 + gsl_rng_uniform_int (r, 24);
149+
ol_q_crysym (SSet[dtess].SeedOri[dcell], "cubic", n1, qtmp);
150+
ol_q_q_q_cur (qtmp, qX, (*pOSet).q[i]);
151+
}
152+
153+
ol_q_free (qX);
154+
ol_q_free (qtmp);
155+
gsl_rng_free (r);
156+
ol_g_free (X);
157+
105158
if (partqty == 2)
106-
ut_string_string (parts[1], &spread);
159+
net_ori_addspread (parts[1], SSet[dtess].Random + dcell, pOSet);
107160

108-
status = 0;
109-
if (!strcmp (parts[0], "parent"))
110-
ol_q_memcpy (SSet[dtess].SeedOri[dcell], q);
111-
else
112-
status = ol_label_q (parts[0], q);
161+
ol_q_free (q);
162+
ut_free_2d_char (&parts, partqty);
113163

114-
if (!status)
164+
return;
165+
}
166+
167+
void
168+
net_ori_ti_beta2alpha (long random, char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet)
169+
{
170+
unsigned int i;
171+
int partqty;
172+
double *q = ol_q_alloc ();
173+
char **parts = NULL;
174+
int status_parent, status_child;
175+
int n1;
176+
double **qX = ut_alloc_2d (13, 4);
177+
double *qtmp = ol_q_alloc ();
178+
gsl_rng *r = NULL;
179+
180+
ut_list_break (label, NEUT_SEP_DEP, &parts, &partqty);
181+
182+
// After (Fortes, 1984)
183+
if (strcmp (parts[0], "ti_beta2alpha") && strcmp (parts[0], "Ti_beta2alpha"))
184+
abort ();
185+
186+
// Checking crystal symmetries
187+
status_parent = 0; // 1: warning, 2: error
188+
status_child = 0; // 1: warning, 2: error
189+
if (strcmp (SSet[dtess].crysym, "cubic") || strcmp ((*pOSet).crysym, "hexagonal"))
115190
{
116-
ol_set_misorispread (spread, 3, SSet[dtess].Random + dcell, pOSet);
191+
if (strcmp (SSet[dtess].crysym, "cubic"))
192+
status_parent = (!strcmp (SSet[dtess].crysym, "triclinic")) ? 1 : 2;
117193

118-
for (i = 0; i < (*pOSet).size; i++)
119-
ol_q_q_q_ref (q, (*pOSet).q[i], (*pOSet).q[i]);
194+
if (strcmp ((*pOSet).crysym, "hexagonal"))
195+
status_child = (!strcmp (SSet[dtess].crysym, "triclinic")) ? 1 : 2;
196+
}
197+
198+
if (ut_num_max (status_parent, status_child) == 1)
199+
ut_print_message (1, 2, "beta2alpha transformation assumes cubic parent and hexagonal child phases.\n");
200+
else if (ut_num_max (status_parent, status_child) == 2)
201+
ut_print_message (2, 2, "beta2alpha transformation requires cubic parent and hexagonal child phases.\n");
202+
203+
ol_q_set_this (qX[1], 0.704416, 0.541675, -0.454519, -0.061628);
204+
ol_q_set_this (qX[2], 0.901980, 0.082828, 0.373612, 0.199964);
205+
ol_q_set_this (qX[3], 0.704416, 0.541675, 0.454519, 0.061628);
206+
ol_q_set_this (qX[4], 0.901980, 0.082828, -0.373612, -0.199964);
207+
ol_q_set_this (qX[5], 0.923000, 0.382319, -0.016692, 0.040299);
208+
ol_q_set_this (qX[6], 0.704416, -0.541675, -0.454519, 0.061628);
209+
ol_q_set_this (qX[7], 0.923000, -0.382319, -0.016692, -0.040299);
210+
ol_q_set_this (qX[8], 0.704416, -0.541675, 0.454519, -0.061628);
211+
ol_q_set_this (qX[9], 0.901980, -0.082828, 0.373612, -0.199964);
212+
ol_q_set_this (qX[10], 0.923000, 0.382319, 0.016692, -0.040299);
213+
ol_q_set_this (qX[11], 0.901980, -0.082828, -0.373612, 0.199964);
214+
ol_q_set_this (qX[12], 0.923000, -0.382319, 0.016692, 0.040299);
215+
for (i = 1; i <= 12; i++)
216+
ol_q_set_unit (qX[i]);
217+
218+
r = gsl_rng_alloc (gsl_rng_ranlxd2);
219+
gsl_rng_set (r, random - 1);
220+
221+
ut_print_message (0, 2, "Applying beta->alpha...\n");
222+
223+
for (i = 0; i < (*pOSet).size; i++)
224+
{
225+
n1 = 1 + gsl_rng_uniform_int (r, 12);
226+
// ol_q_crysym (SSet[dtess].SeedOri[dcell], "cubic", n1, qtmp);
227+
ol_q_q_q_cur (SSet[dtess].SeedOri[dcell], qX[n1], (*pOSet).q[i]);
120228
}
121229

230+
ut_free_2d (&qX, 13);
231+
ol_q_free (qtmp);
232+
gsl_rng_free (r);
233+
234+
if (partqty == 2)
235+
net_ori_addspread (parts[1], SSet[dtess].Random + dcell, pOSet);
236+
237+
ol_q_free (q);
238+
ut_free_2d_char (&parts, partqty);
239+
240+
return;
241+
}
242+
243+
void
244+
net_ori_parent (char *string, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet)
245+
{
246+
int i, partqty;
247+
char **parts = NULL;
248+
249+
ut_list_break (string, NEUT_SEP_DEP, &parts, &partqty);
250+
251+
for (i = 0; i < (int) (*pOSet).size; i++)
252+
ol_q_memcpy (SSet[dtess].SeedOri[dcell], (*pOSet).q[i]);
253+
254+
if (partqty == 2)
255+
net_ori_addspread (parts[1], SSet[dtess].Random + dcell, pOSet);
256+
257+
ut_free_2d_char (&parts, partqty);
258+
259+
return;
260+
}
261+
262+
void
263+
net_ori_label (char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet)
264+
{
265+
int i, status, partqty;
266+
double *q = ol_q_alloc ();
267+
char **parts = NULL;
268+
269+
ut_list_break (label, NEUT_SEP_DEP, &parts, &partqty);
270+
271+
status = ol_label_q (parts[0], q);
122272
if (status)
123273
abort ();
124274

275+
for (i = 0; i < (int) (*pOSet).size; i++)
276+
ol_q_memcpy (q, (*pOSet).q[i]);
277+
278+
if (partqty == 2)
279+
net_ori_addspread (parts[1], SSet[dtess].Random + dcell, pOSet);
280+
125281
ol_q_free (q);
126282
ut_free_2d_char (&parts, partqty);
127-
ut_free_1d_char (&spread);
128283

129284
return;
130285
}

src/neper_t/net_ori/net_ori3.c

+16
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,19 @@ net_ori_odf_pre (char *odf, struct OL_SET *pOSet, struct ODF *pOdf)
5050

5151
return;
5252
}
53+
54+
void
55+
net_ori_addspread (char *spread, long random, struct OL_SET *pOSet)
56+
{
57+
int i;
58+
struct OL_SET OSet2 = ol_set_alloc ((*pOSet).size, (*pOSet).crysym);
59+
60+
ol_set_misorispread (spread, 3, random, &OSet2);
61+
62+
for (i = 0; i < (int) (*pOSet).size; i++)
63+
ol_q_q_q_ref ((*pOSet).q[i], OSet2.q[i], (*pOSet).q[i]);
64+
65+
ol_set_free (&OSet2);
66+
67+
return;
68+
}

src/neper_t/net_ori/net_ori_.h

+12-3
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,6 @@ extern void net_ori_qty (struct SEEDSET *pSSet, char **parts, int partqty, int *
2424
extern void net_ori_fiber (struct SEEDSET *SSet, int dtess, int dcell, long random,
2525
char *distrib, struct OL_SET *pOSet);
2626

27-
extern void net_ori_label (char *label, struct SEEDSET *SSet, int dtess, int dcell,
28-
struct OL_SET *pOSet);
29-
3027
extern void net_ori_odf (long random, char *odf, struct OL_SET *pOSet);
3128
extern void net_ori_odf_pre (char *odf, struct OL_SET *pOSet, struct ODF *pOdf);
3229

@@ -42,3 +39,15 @@ extern int net_ori_mtess_randseed_rand (int *N, int *id, int *poly, int levelqty
4239
extern void net_ori_orispread (char *orispread, struct SEEDSET *pSSet);
4340

4441
extern void net_orispread_file (char *orispread, struct SEEDSET *pSSet);
42+
43+
extern void net_ori_addspread (char *spread, long random, struct OL_SET *pOSet);
44+
45+
extern void net_ori_ks (long random, char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet);
46+
47+
extern void net_ori_ti_beta2alpha (long random, char *label, struct SEEDSET *SSet, int dtess, int dcell, struct OL_SET *pOSet);
48+
49+
extern void net_ori_parent (char *label, struct SEEDSET *SSet, int dtess, int dcell,
50+
struct OL_SET *pOSet);
51+
52+
extern void net_ori_label (char *label, struct SEEDSET *SSet, int dtess, int dcell,
53+
struct OL_SET *pOSet);

src/neper_t/net_tess/net_tess3d/net_tess3d_periodic/net_tess3d_periodic.h

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ extern "C"
88
#endif
99

1010
extern void net_tess3d_periodic (struct TESS *pTess);
11+
extern void net_tess3d_periodic_ver_shrinkmaster (struct TESS *);
12+
extern void net_tess3d_periodic_edge_shrinkmaster (struct TESS *);
13+
extern void net_tess2d_periodic_edge_peredgeori (struct TESS *pTess);
14+
extern void net_tess3d_periodic_edge_peredgeori (struct TESS *pTess);
1115

1216
#ifdef __cplusplus
1317
}

src/neper_t/net_tess/net_tess3d/net_tess3d_periodic/net_tess3d_periodic_.h

-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ extern void net_tess3d_periodic_face (struct TESS *pTess);
1717
extern void net_tess3d_periodic_edge (struct TESS *pTess);
1818
extern void net_tess3d_periodic_ver (struct TESS *pTess);
1919

20-
extern void net_tess3d_periodic_ver_shrinkmaster (struct TESS *);
21-
extern void net_tess3d_periodic_edge_shrinkmaster (struct TESS *);
22-
extern void net_tess3d_periodic_edge_peredgeori (struct TESS *pTess);
23-
2420
extern void net_tess3d_periodic_face_rodrigues (struct TESS *pTess);
2521
extern void net_tess3d_periodic_edge_rodrigues (struct TESS *pTess);
2622
extern void net_tess3d_periodic_ver_rodrigues (struct TESS *pTess);

0 commit comments

Comments
 (0)