Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
qbox-public
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
qbox
qbox-public
Commits
00fb07e1
Commit
00fb07e1
authored
Apr 14, 2019
by
Francois Gygi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add ForceTol.h and StressTol.h
parent
c1bad59f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
138 additions
and
0 deletions
+138
-0
ForceTol.h
src/ForceTol.h
+69
-0
StressTol.h
src/StressTol.h
+69
-0
No files found.
src/ForceTol.h
0 → 100644
View file @
00fb07e1
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// ForceTol.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef FORCETOL_H
#define FORCETOL_H
#include<iostream>
#include<iomanip>
#include<sstream>
#include<stdlib.h>
#include "Sample.h"
class
ForceTol
:
public
Var
{
Sample
*
s
;
public
:
const
char
*
name
(
void
)
const
{
return
"force_tol"
;
};
int
set
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
if
(
ui
->
onpe0
()
)
cout
<<
" force_tol takes only one value"
<<
endl
;
return
1
;
}
double
v
=
atof
(
argv
[
1
]);
if
(
v
<
0
.
0
)
{
if
(
ui
->
onpe0
()
)
cout
<<
" force_tol must be non-negative"
<<
endl
;
return
1
;
}
s
->
ctrl
.
force_tol
=
v
;
return
0
;
}
string
print
(
void
)
const
{
ostringstream
st
;
st
.
setf
(
ios
::
left
,
ios
::
adjustfield
);
st
<<
setw
(
10
)
<<
name
()
<<
" = "
;
st
.
setf
(
ios
::
right
,
ios
::
adjustfield
);
st
<<
setw
(
10
)
<<
s
->
ctrl
.
scf_tol
;
return
st
.
str
();
}
ForceTol
(
Sample
*
sample
)
:
s
(
sample
)
{
s
->
ctrl
.
force_tol
=
0
.
0
;
}
};
#endif
src/StressTol.h
0 → 100644
View file @
00fb07e1
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2014 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// StressTol.h
//
////////////////////////////////////////////////////////////////////////////////
#ifndef STRESSTOL_H
#define STRESSTOL_H
#include<iostream>
#include<iomanip>
#include<sstream>
#include<stdlib.h>
#include "Sample.h"
class
StressTol
:
public
Var
{
Sample
*
s
;
public
:
const
char
*
name
(
void
)
const
{
return
"stress_tol"
;
};
int
set
(
int
argc
,
char
**
argv
)
{
if
(
argc
!=
2
)
{
if
(
ui
->
onpe0
()
)
cout
<<
" stress_tol takes only one value"
<<
endl
;
return
1
;
}
double
v
=
atof
(
argv
[
1
]);
if
(
v
<
0
.
0
)
{
if
(
ui
->
onpe0
()
)
cout
<<
" stress_tol must be non-negative"
<<
endl
;
return
1
;
}
s
->
ctrl
.
stress_tol
=
v
;
return
0
;
}
string
print
(
void
)
const
{
ostringstream
st
;
st
.
setf
(
ios
::
left
,
ios
::
adjustfield
);
st
<<
setw
(
10
)
<<
name
()
<<
" = "
;
st
.
setf
(
ios
::
right
,
ios
::
adjustfield
);
st
<<
setw
(
10
)
<<
s
->
ctrl
.
scf_tol
;
return
st
.
str
();
}
StressTol
(
Sample
*
sample
)
:
s
(
sample
)
{
s
->
ctrl
.
stress_tol
=
0
.
0
;
}
};
#endif
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment