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
5e7bcf32
Commit
5e7bcf32
authored
13 years ago
by
Jonathan Lambrechts
Browse files
Options
Downloads
Patches
Plain Diff
dg : coordinates function again
parent
0583e024
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
+37
-0
37 additions, 0 deletions
Solver/function.cpp
Solver/function.h
+6
-2
6 additions, 2 deletions
Solver/function.h
with
43 additions
and
2 deletions
Solver/function.cpp
+
37
−
0
View file @
5e7bcf32
...
@@ -224,6 +224,19 @@ const function * dataCacheMap::_translate(const function *f) const
...
@@ -224,6 +224,19 @@ const function * dataCacheMap::_translate(const function *f) const
Msg
::
Error
(
"solution function gradient has not been set"
);
Msg
::
Error
(
"solution function gradient has not been set"
);
}
}
}
}
if
(
f
==
function
::
getCoordinates
())
{
f
=
_functionCoordinates
;
if
(
f
==
NULL
)
{
dataCacheMap
*
parent
=
_parent
;
while
(
parent
)
{
f
=
parent
->
_functionCoordinates
;
if
(
f
)
break
;
parent
=
parent
->
_parent
;
}
if
(
f
==
NULL
)
Msg
::
Error
(
"function coordinates has not been set"
);
}
}
return
f
;
return
f
;
}
}
...
@@ -749,3 +762,27 @@ functionC::functionC (std::string file, std::string symbol, int nbCol,
...
@@ -749,3 +762,27 @@ functionC::functionC (std::string file, std::string symbol, int nbCol,
Msg
::
Error
(
"Cannot construct functionC without dlopen"
);
Msg
::
Error
(
"Cannot construct functionC without dlopen"
);
#endif
#endif
}
}
class
functionCoordinates
:
public
function
{
static
functionCoordinates
*
_instance
;
functionCoordinates
()
:
function
(
3
)
{};
public
:
void
call
(
dataCacheMap
*
m
,
fullMatrix
<
double
>
&
sol
)
{
Msg
::
Error
(
"A function requires the coordinates but this algorithm does "
"not provide the coordinates"
);
throw
;
}
static
functionCoordinates
*
get
()
{
if
(
!
_instance
)
_instance
=
new
functionCoordinates
();
return
_instance
;
}
};
functionCoordinates
*
functionCoordinates
::
_instance
=
NULL
;
function
*
function
::
getCoordinates
()
{
return
functionCoordinates
::
get
();
}
This diff is collapsed.
Click to expand it.
Solver/function.h
+
6
−
2
View file @
5e7bcf32
...
@@ -72,6 +72,7 @@ class function {
...
@@ -72,6 +72,7 @@ class function {
static
functionConstant
*
getTime
();
static
functionConstant
*
getTime
();
static
functionConstant
*
getDT
();
static
functionConstant
*
getDT
();
static
function
*
getSolution
();
static
function
*
getSolution
();
static
function
*
getCoordinates
();
static
function
*
getSolutionGradient
();
static
function
*
getSolutionGradient
();
static
function
*
getNormals
();
static
function
*
getNormals
();
void
printDep
()
void
printDep
()
...
@@ -197,7 +198,7 @@ class dataCacheDouble {
...
@@ -197,7 +198,7 @@ class dataCacheDouble {
};
};
class
dataCacheMap
{
class
dataCacheMap
{
const
function
*
_functionSolution
,
*
_functionSolutionGradient
;
const
function
*
_functionSolution
,
*
_functionSolutionGradient
,
*
_functionCoordinates
;
//handle function solution and funciton solution gradient
//handle function solution and funciton solution gradient
//we should get rid of them
//we should get rid of them
const
function
*
_translate
(
const
function
*
)
const
;
const
function
*
_translate
(
const
function
*
)
const
;
...
@@ -211,7 +212,7 @@ class dataCacheMap {
...
@@ -211,7 +212,7 @@ class dataCacheMap {
std
::
vector
<
dataCacheDouble
*>
_toInvalidateOnElement
;
std
::
vector
<
dataCacheDouble
*>
_toInvalidateOnElement
;
MElement
*
_element
;
MElement
*
_element
;
dataCacheMap
()
{
dataCacheMap
()
{
_functionSolution
=
_functionSolutionGradient
=
NULL
;
_functionSolution
=
_functionSolutionGradient
=
_functionCoordinates
=
NULL
;
_nbEvaluationPoints
=
0
;
_nbEvaluationPoints
=
0
;
_parent
=
NULL
;
_parent
=
NULL
;
}
}
...
@@ -258,6 +259,9 @@ class dataCacheMap {
...
@@ -258,6 +259,9 @@ class dataCacheMap {
m
->
_nbEvaluationPoints
=
0
;
m
->
_nbEvaluationPoints
=
0
;
return
m
;
return
m
;
}
}
inline
void
setFunctionCoordinates
(
const
function
*
functionCoordinates
)
{
_functionCoordinates
=
functionCoordinates
;
}
inline
void
setSolutionFunction
(
const
function
*
functionSolution
,
const
function
*
functionSolutionGradient
)
{
inline
void
setSolutionFunction
(
const
function
*
functionSolution
,
const
function
*
functionSolutionGradient
)
{
_functionSolution
=
functionSolution
;
_functionSolution
=
functionSolution
;
_functionSolutionGradient
=
functionSolutionGradient
;
_functionSolutionGradient
=
functionSolutionGradient
;
...
...
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