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
f12d946b
Commit
f12d946b
authored
14 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
dg : add functionConstantByTag
parent
e2def8ec
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Solver/function.cpp
+16
-8
16 additions, 8 deletions
Solver/function.cpp
Solver/function.h
+3
-15
3 additions, 15 deletions
Solver/function.h
with
19 additions
and
23 deletions
Solver/function.cpp
+
16
−
8
View file @
f12d946b
...
@@ -50,14 +50,14 @@ functionConstant *function::_dtFunction = NULL;
...
@@ -50,14 +50,14 @@ functionConstant *function::_dtFunction = NULL;
functionConstant
*
function
::
getTime
()
functionConstant
*
function
::
getTime
()
{
{
if
(
!
_timeFunction
)
if
(
!
_timeFunction
)
_timeFunction
=
functionConstant
New
(
0.
);
_timeFunction
=
new
functionConstant
(
0.
);
return
_timeFunction
;
return
_timeFunction
;
}
}
functionConstant
*
function
::
getDT
()
functionConstant
*
function
::
getDT
()
{
{
if
(
!
_dtFunction
)
if
(
!
_dtFunction
)
_dtFunction
=
functionConstant
New
(
0.
);
_dtFunction
=
new
functionConstant
(
0.
);
return
_dtFunction
;
return
_dtFunction
;
}
}
...
@@ -367,16 +367,24 @@ void functionConstant::set(double val)
...
@@ -367,16 +367,24 @@ void functionConstant::set(double val)
_source
(
0
,
0
)
=
val
;
_source
(
0
,
0
)
=
val
;
}
}
functionConstant
*
functionConstantNew
(
double
v
)
void
functionConstant
::
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
{
{
std
::
vector
<
double
>
vec
(
1
);
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
vec
[
0
]
=
v
;
for
(
int
j
=
0
;
j
<
_source
.
size1
();
j
++
)
return
new
functionConstant
(
vec
);
val
(
i
,
j
)
=
_source
(
j
,
0
);
}
}
functionConstant
*
functionConstant
New
(
const
std
::
vector
<
double
>
&
v
)
functionConstant
::
functionConstant
(
std
::
vector
<
double
>
source
)
:
function
(
source
.
size
())
{
{
return
new
functionConstant
(
v
);
_source
=
fullMatrix
<
double
>
(
source
.
size
(),
1
);
for
(
size_t
i
=
0
;
i
<
source
.
size
();
i
++
)
_source
(
i
,
0
)
=
source
[
i
];
}
functionConstant
::
functionConstant
(
double
source
)
:
function
(
1
)
{
_source
.
resize
(
1
,
1
);
_source
(
0
,
0
)
=
source
;
}
}
// functionSum
// functionSum
...
...
This diff is collapsed.
Click to expand it.
Solver/function.h
+
3
−
15
View file @
f12d946b
...
@@ -274,18 +274,9 @@ class dataCacheMap {
...
@@ -274,18 +274,9 @@ class dataCacheMap {
class
functionConstant
:
public
function
{
class
functionConstant
:
public
function
{
public:
public:
fullMatrix
<
double
>
_source
;
fullMatrix
<
double
>
_source
;
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
)
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
val
);
{
functionConstant
(
std
::
vector
<
double
>
source
);
for
(
int
i
=
0
;
i
<
val
.
size1
();
i
++
)
functionConstant
(
double
source
);
for
(
int
j
=
0
;
j
<
_source
.
size1
();
j
++
)
val
(
i
,
j
)
=
_source
(
j
,
0
);
}
functionConstant
(
std
::
vector
<
double
>
source
)
:
function
(
source
.
size
())
{
_source
=
fullMatrix
<
double
>
(
source
.
size
(),
1
);
for
(
size_t
i
=
0
;
i
<
source
.
size
();
i
++
)
_source
(
i
,
0
)
=
source
[
i
];
}
void
set
(
double
val
);
void
set
(
double
val
);
};
};
...
@@ -300,9 +291,6 @@ class functionC : public function {
...
@@ -300,9 +291,6 @@ class functionC : public function {
std
::
vector
<
const
function
*>
dependencies
);
std
::
vector
<
const
function
*>
dependencies
);
};
};
functionConstant
*
functionConstantNew
(
const
std
::
vector
<
double
>&
);
functionConstant
*
functionConstantNew
(
double
);
function
*
functionSumNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionSumNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionProdNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionProdNew
(
const
function
*
f0
,
const
function
*
f1
);
function
*
functionScaleNew
(
const
function
*
f0
,
const
double
s
);
function
*
functionScaleNew
(
const
function
*
f0
,
const
double
s
);
...
...
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