https://mooseframework.inl.gov
Loading...
Searching...
No Matches
solid_mechanics
test
plugins
mutex_test.C
Go to the documentation of this file.
1
//* This file is part of the MOOSE framework
2
//* https://mooseframework.inl.gov
3
//*
4
//* All rights reserved, see COPYRIGHT for full restrictions
5
//* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6
//*
7
//* Licensed under LGPL 2.1, please see LICENSE for details
8
//* https://www.gnu.org/licenses/lgpl-2.1.html
9
10
/***************************************************************************************
11
** UMAT, FOR ABAQUS/STANDARD INCORPORATING ISOTROPIC ELASTICITY **
12
***************************************************************************************/
13
14
#include "
SMAAspUserSubroutines.h
"
15
#include "
SMAAspUserUtilities.h
"
16
#include "
MooseError.h
"
17
18
Real
mutex_test_global_thread_counter
;
19
20
extern
"C"
void
21
uexternaldb_
(
int
* LOP,
22
int
*
/* LRESTART */
,
23
Real
/* TIME */
[],
24
Real *
/* DTIME */
,
25
int
*
/* KSTEP */
,
26
int
*
/* KINC */
)
27
{
28
switch
(*LOP)
29
{
30
// beginning of the simulation
31
case
0:
32
{
33
MutexInit
(2);
34
MutexLock
(2);
35
mutex_test_global_thread_counter
= 0;
36
MutexUnlock
(2);
37
break
;
38
}
39
40
// beginning of the timestep
41
case
1:
42
{
43
for
(
int
i = 0; i < 1000; ++i)
44
{
45
MutexLock
(2);
46
mutex_test_global_thread_counter
+= 1;
47
MutexUnlock
(2);
48
}
49
break
;
50
}
51
52
// end of the simulation
53
case
3:
54
{
55
if
(
get_thread_id_
() == 0)
56
Moose::out <<
"sum = "
<<
mutex_test_global_thread_counter
<<
".\n"
;
57
break
;
58
}
59
}
60
}
MooseError.h
SMAAspUserSubroutines.h
MutexInit
void MutexInit(int id)
Definition
AbaqusUtils.C:386
MutexUnlock
void MutexUnlock(int id)
Definition
AbaqusUtils.C:398
MutexLock
void MutexLock(int id)
Definition
AbaqusUtils.C:392
SMAAspUserUtilities.h
get_thread_id_
int get_thread_id_()
Definition
AbaqusUtils.C:58
mutex_test_global_thread_counter
Real mutex_test_global_thread_counter
Definition
mutex_test.C:18
uexternaldb_
void uexternaldb_(int *LOP, int *, Real[], Real *, int *, int *)
Definition
mutex_test.C:21
Generated on Fri Sep 11 2026 20:36:57 for https://mooseframework.inl.gov by
1.9.8