https://mooseframework.inl.gov
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
using namespace
libMesh
;
19
20
Real
mutex_test_global_thread_counter
;
21
22
extern
"C"
void
23
uexternaldb_
(
int
* LOP,
24
int
*
/* LRESTART */
,
25
Real
/* TIME */
[],
26
Real
*
/* DTIME */
,
27
int
*
/* KSTEP */
,
28
int
*
/* KINC */
)
29
{
30
switch
(*LOP)
31
{
32
// beginning of the simulation
33
case
0:
34
{
35
MutexInit
(2);
36
MutexLock
(2);
37
mutex_test_global_thread_counter
= 0;
38
MutexUnlock
(2);
39
break
;
40
}
41
42
// beginning of the timestep
43
case
1:
44
{
45
for
(
int
i = 0; i < 1000; ++i)
46
{
47
MutexLock
(2);
48
mutex_test_global_thread_counter
+= 1;
49
MutexUnlock
(2);
50
}
51
break
;
52
}
53
54
// end of the simulation
55
case
3:
56
{
57
if
(
get_thread_id_
() == 0)
58
Moose::out <<
"sum = "
<<
mutex_test_global_thread_counter
<<
".\n"
;
59
break
;
60
}
61
}
62
}
MutexInit
void MutexInit(int id)
Definition:
AbaqusUtils.C:386
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:20
libMesh
The following methods are specializations for using the Parallel::packed_range_* routines for a vecto...
MutexUnlock
void MutexUnlock(int id)
Definition:
AbaqusUtils.C:398
MooseError.h
uexternaldb_
void uexternaldb_(int *LOP, int *, Real [], Real *, int *, int *)
Definition:
mutex_test.C:23
SMAAspUserUtilities.h
libMesh::Real
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
MutexLock
void MutexLock(int id)
Definition:
AbaqusUtils.C:392
SMAAspUserSubroutines.h
Generated on Thu Jul 17 2025 01:44:42 for https://mooseframework.inl.gov by
1.8.14