Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gmsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
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
Larry Price
gmsh
Commits
1bd022ef
Commit
1bd022ef
authored
13 years ago
by
Thomas De Maet
Browse files
Options
Downloads
Patches
Plain Diff
nonInertiaSW + some fixes
parent
8d85883f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/function.cpp
+20
-20
20 additions, 20 deletions
Solver/function.cpp
Solver/function.h
+1
-1
1 addition, 1 deletion
Solver/function.h
with
21 additions
and
21 deletions
Solver/function.cpp
+
20
−
20
View file @
1bd022ef
...
...
@@ -96,7 +96,7 @@ class functionNormals : public function {
static
functionNormals
*
_instance
;
// constructor is private only 1 instance can exists, call get to
// access the instance
functionNormals
()
:
function
(
1
){}
functionNormals
()
:
function
(
0
){}
public
:
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
sol
)
{
...
...
@@ -468,11 +468,11 @@ class functionLevelsetSmooth : public function {
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
for
(
int
j
=
0
;
j
<
val
.
size2
();
j
++
){
double
phi
=
_f0
(
i
,
j
);
double
Heps
=
0.5
*
(
1
+
phi
/
_E
+
1.
/
M_PI
*
sin
(
M_PI
*
phi
/
_E
));
if
(
fabs
(
phi
)
<
_E
)
val
(
i
,
j
)
=
Heps
*
_valPlus
+
(
1
-
Heps
)
*
_valMin
;
else
if
(
phi
>
_E
)
val
(
i
,
j
)
=
_valPlus
;
else
if
(
phi
<
-
_E
)
val
(
i
,
j
)
=
_valMin
;
double
phi
=
_f0
(
i
,
j
);
double
Heps
=
0.5
*
(
1
+
phi
/
_E
+
1.
/
M_PI
*
sin
(
M_PI
*
phi
/
_E
));
if
(
fabs
(
phi
)
<
_E
)
val
(
i
,
j
)
=
Heps
*
_valPlus
+
(
1
-
Heps
)
*
_valMin
;
else
if
(
phi
>
_E
)
val
(
i
,
j
)
=
_valPlus
;
else
if
(
phi
<
-
_E
)
val
(
i
,
j
)
=
_valMin
;
}
}
functionLevelsetSmooth
(
const
function
*
f0
,
const
double
valMin
,
const
double
valPlus
,
const
double
E
)
:
function
(
f0
->
getNbCol
())
...
...
@@ -592,28 +592,28 @@ function *functionScaleNew(const function *f0, const double s) {
// functionMean
class
functionMean
:
public
function
{
fullMatrix
<
double
>
_f
0
;
class
functionMean
P1
:
public
function
{
fullMatrix
<
double
>
_f
,
_df
,
_xyz
;
public:
functionMean
(
const
function
*
f0
)
:
function
(
f0
->
getNbCol
())
{
setArgument
(
_f0
,
f0
);
functionMeanP1
(
const
function
*
f
,
const
function
*
df
)
:
function
(
f
->
getNbCol
())
{
setArgument
(
_f
,
f
);
setArgument
(
_df
,
df
);
setArgument
(
_xyz
,
function
::
getCoordinates
());
}
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
{
double
mean
;
for
(
int
j
=
0
;
j
<
val
.
size2
();
j
++
)
{
mean
=
0
;
SPoint3
center
=
m
->
getElement
()
->
barycenter
();
for
(
int
j
=
0
;
j
<
val
.
size2
();
j
++
)
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
mean
+=
_f0
(
i
,
j
);
mean
/=
(
double
)
val
.
size1
();
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
val
(
i
,
j
)
=
mean
;
}
val
(
i
,
j
)
=
_f
(
i
,
j
)
+
_df
(
i
,
3
*
j
+
0
)
*
(
center
.
x
()
-
_xyz
(
i
,
0
)
)
+
_df
(
i
,
3
*
j
+
1
)
*
(
center
.
y
()
-
_xyz
(
i
,
1
)
)
+
_df
(
i
,
3
*
j
+
2
)
*
(
center
.
z
()
-
_xyz
(
i
,
2
)
);
}
};
function
*
functionMeanNew
(
const
function
*
f
0
)
{
return
new
functionMean
(
f
0
);
function
*
functionMean
P1
New
(
const
function
*
f
,
const
function
*
df
)
{
return
new
functionMean
P1
(
f
,
df
);
}
// functionStructuredGridFile
...
...
This diff is collapsed.
Click to expand it.
Solver/function.h
+
1
−
1
View file @
1bd022ef
...
...
@@ -298,5 +298,5 @@ function *functionProdNew (const function *f0, const function *f1);
function
*
functionScaleNew
(
const
function
*
f0
,
const
double
s
);
function
*
functionExtractCompNew
(
const
function
*
f0
,
const
int
iComp
);
function
*
functionCatCompNew
(
std
::
vector
<
const
function
*>
fArray
);
function
*
functionMeanNew
(
const
function
*
f
0
);
function
*
functionMean
P1
New
(
const
function
*
f
,
const
function
*
df
);
#endif
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