Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cm3Libraries
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm3
cm3Libraries
Commits
e1dd8913
Commit
e1dd8913
authored
4 years ago
by
Ludovic Noels
Browse files
Options
Downloads
Patches
Plain Diff
add return and use strcpy
parent
a8a09529
No related branches found
No related tags found
1 merge request
!310
Master - transfer updates into WIP branch
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
NonLinearSolver/materialLaw/RandomField.cpp
+13
-6
13 additions, 6 deletions
NonLinearSolver/materialLaw/RandomField.cpp
NonLinearSolver/materialLaw/RandomField.h
+1
-1
1 addition, 1 deletion
NonLinearSolver/materialLaw/RandomField.h
with
14 additions
and
7 deletions
NonLinearSolver/materialLaw/RandomField.cpp
+
13
−
6
View file @
e1dd8913
...
...
@@ -40,6 +40,7 @@ Yarn_class& Yarn_class::operator=(const Yarn_class &source){
_l
=
source
.
_l
;
_WirGeo
=
source
.
_WirGeo
;
_Warp_Weft
=
source
.
_Warp_Weft
;
return
*
this
;
}
Yarn_class
::~
Yarn_class
(){};
...
...
@@ -56,6 +57,7 @@ double Yarn_class::WireFunc(const double x, const double b, const double L) cons
tmp
=
2.0
*
PI
/
L
;
return
b
*
cos
(
tmp
*
x
);
}
return
0.
;
}
double
Yarn_class
::
WireFunc_Tang
(
const
double
x
,
const
double
b
,
const
double
L
)
const
{
...
...
@@ -68,6 +70,7 @@ double Yarn_class::WireFunc_Tang(const double x, const double b, const double L)
tmp
=
2.0
*
PI
/
L
;
return
-
b
*
sin
(
tmp
*
x
)
*
tmp
;
}
return
0.
;
}
void
Yarn_class
::
Inside_Yarn
(
const
SVector3
&
GaussP
,
double
&
k
,
double
*
V_Rand
)
const
{
...
...
@@ -206,6 +209,7 @@ Random_Fclass& Random_Fclass::operator=(const Random_Fclass &source){
_nx
=
source
.
_nx
;
_ny
=
source
.
_ny
;
_nz
=
source
.
_nz
;
return
*
this
;
}
Random_Fclass
::~
Random_Fclass
(){};
...
...
@@ -219,15 +223,17 @@ Random_Feul::Random_Feul(const double* mean, const SVector3& Ldomain, const doub
_Eul_mean
[
0
]
=
mean
[
0
];
_Eul_mean
[
1
]
=
mean
[
1
];
_Eul_mean
[
2
]
=
mean
[
2
];
if
(
Geo
!=
NULL
)
_Geo
=
Geo
;
if
(
Geo
!=
NULL
)
strcpy
(
_Geo
,
Geo
)
;
if
(
strcmp
(
_Geo
,
"Cos"
)
==
0
or
strcmp
(
_Geo
,
"Logistic"
)
==
0
){
double
a
=
dx
;
double
b
=
dy
;
double
L
=
_Ldomain
.
x
();
double
l
=
dz
;
double
tmpX
,
tmpY
,
tmpZ
;
char
*
weft
=
"Weft"
;
char
*
warp
=
"Warp"
;
const
char
*
weft
=
"Weft"
;
//strcpy(weft,"Weft");
const
char
*
warp
=
"Warp"
;
//strcpy(warp,"Warp");
tmpY
=
_OrigY
-
L
/
2.0
;
tmpZ
=
b
;
Weft1
=
init_Yarn
(
_OrigX
,
tmpY
,
-
tmpZ
,
a
,
b
,
L
,
l
,
_Geo
,
weft
);
...
...
@@ -252,7 +258,7 @@ Random_Feul::Random_Feul(const Random_Feul &source):Random_Fclass(source){
_Eul_mean
[
0
]
=
source
.
_Eul_mean
[
0
];
_Eul_mean
[
1
]
=
source
.
_Eul_mean
[
1
];
_Eul_mean
[
2
]
=
source
.
_Eul_mean
[
2
];
_Geo
=
source
.
_Geo
;
strcpy
(
_Geo
,
source
.
_Geo
)
;
malloctens4
(
&
_RF_eul
,
_nx
,
_ny
,
_nz
,
3
);
for
(
int
i
=
0
;
i
<
_nx
;
i
++
){
...
...
@@ -291,7 +297,7 @@ Random_Feul& Random_Feul::operator=(const Random_Fclass &source){
_Eul_mean
[
0
]
=
src
->
_Eul_mean
[
0
];
_Eul_mean
[
1
]
=
src
->
_Eul_mean
[
1
];
_Eul_mean
[
2
]
=
src
->
_Eul_mean
[
2
];
_Geo
=
src
->
_Geo
;
strcpy
(
_Geo
,
src
->
_Geo
)
;
for
(
int
i
=
0
;
i
<
_nx
;
i
++
){
for
(
int
j
=
0
;
j
<
_ny
;
j
++
){
...
...
@@ -320,7 +326,7 @@ Random_Feul& Random_Feul::operator=(const Random_Fclass &source){
Warp2
=
src
->
Warp2
->
clone
();
Warp3
=
src
->
Warp3
->
clone
();
}
return
*
this
;
}
...
...
@@ -426,6 +432,7 @@ Random_FProp& Random_FProp::operator=(const Random_Fclass &source){
}
}
}
return
*
this
;
}
Random_FProp
::~
Random_FProp
(){
...
...
This diff is collapsed.
Click to expand it.
NonLinearSolver/materialLaw/RandomField.h
+
1
−
1
View file @
e1dd8913
...
...
@@ -74,7 +74,7 @@ class Random_Feul : public Random_Fclass{
double
*
_Eul_mean
;
double
_l
;
double
****
_RF_eul
;
const
char
*
_Geo
;
char
*
_Geo
;
Yarn_class
*
Weft1
,
*
Weft2
,
*
Weft3
,
*
Warp1
,
*
Warp2
,
*
Warp3
;
public:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment