Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dmitri Naumov
ogs
Commits
1d8d8db0
Commit
1d8d8db0
authored
4 years ago
by
Tom Fischer
Browse files
Options
Downloads
Patches
Plain Diff
[ParamLib] Make FunctionParameter independent from mesh.
parent
a401e5af
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
ParameterLib/FunctionParameter.cpp
+2
-5
2 additions, 5 deletions
ParameterLib/FunctionParameter.cpp
ParameterLib/FunctionParameter.h
+2
-16
2 additions, 16 deletions
ParameterLib/FunctionParameter.h
ParameterLib/Parameter.cpp
+1
-1
1 addition, 1 deletion
ParameterLib/Parameter.cpp
with
5 additions
and
22 deletions
ParameterLib/FunctionParameter.cpp
+
2
−
5
View file @
1d8d8db0
...
@@ -11,13 +11,11 @@
...
@@ -11,13 +11,11 @@
#include
"FunctionParameter.h"
#include
"FunctionParameter.h"
#include
"BaseLib/ConfigTree.h"
#include
"BaseLib/ConfigTree.h"
#include
"MeshLib/Mesh.h"
namespace
ParameterLib
namespace
ParameterLib
{
{
std
::
unique_ptr
<
ParameterBase
>
createFunctionParameter
(
std
::
unique_ptr
<
ParameterBase
>
createFunctionParameter
(
std
::
string
const
&
name
,
BaseLib
::
ConfigTree
const
&
config
,
std
::
string
const
&
name
,
BaseLib
::
ConfigTree
const
&
config
)
MeshLib
::
Mesh
const
&
mesh
)
{
{
//! \ogs_file_param{prj__parameters__parameter__type}
//! \ogs_file_param{prj__parameters__parameter__type}
config
.
checkConfigParameter
(
"type"
,
"Function"
);
config
.
checkConfigParameter
(
"type"
,
"Function"
);
...
@@ -31,8 +29,7 @@ std::unique_ptr<ParameterBase> createFunctionParameter(
...
@@ -31,8 +29,7 @@ std::unique_ptr<ParameterBase> createFunctionParameter(
vec_expressions
.
emplace_back
(
expression_str
);
vec_expressions
.
emplace_back
(
expression_str
);
}
}
return
std
::
make_unique
<
FunctionParameter
<
double
>>
(
name
,
mesh
,
return
std
::
make_unique
<
FunctionParameter
<
double
>>
(
name
,
vec_expressions
);
vec_expressions
);
}
}
}
// namespace ParameterLib
}
// namespace ParameterLib
This diff is collapsed.
Click to expand it.
ParameterLib/FunctionParameter.h
+
2
−
16
View file @
1d8d8db0
...
@@ -15,9 +15,6 @@
...
@@ -15,9 +15,6 @@
#include
<exprtk.hpp>
#include
<exprtk.hpp>
#include
"MeshLib/Elements/Element.h"
#include
"MeshLib/Node.h"
#include
"Parameter.h"
#include
"Parameter.h"
#include
"Utils.h"
#include
"Utils.h"
...
@@ -40,14 +37,12 @@ struct FunctionParameter final : public Parameter<T>
...
@@ -40,14 +37,12 @@ struct FunctionParameter final : public Parameter<T>
* Constructing from a vector of expressions
* Constructing from a vector of expressions
*
*
* @param name the parameter's name
* @param name the parameter's name
* @param mesh the parameter's domain of definition.
* @param vec_expression_str a vector of mathematical expressions
* @param vec_expression_str a vector of mathematical expressions
* The vector size specifies the number of components of the parameter.
* The vector size specifies the number of components of the parameter.
*/
*/
FunctionParameter
(
std
::
string
const
&
name
,
FunctionParameter
(
std
::
string
const
&
name
,
MeshLib
::
Mesh
const
&
mesh
,
std
::
vector
<
std
::
string
>
const
&
vec_expression_str
)
std
::
vector
<
std
::
string
>
const
&
vec_expression_str
)
:
Parameter
<
T
>
(
name
,
&
mesh
),
_vec_expression_str
(
vec_expression_str
)
:
Parameter
<
T
>
(
name
,
nullptr
),
_vec_expression_str
(
vec_expression_str
)
{
{
_symbol_table
.
add_constants
();
_symbol_table
.
add_constants
();
_symbol_table
.
create_variable
(
"x"
);
_symbol_table
.
create_variable
(
"x"
);
...
@@ -89,14 +84,6 @@ struct FunctionParameter final : public Parameter<T>
...
@@ -89,14 +84,6 @@ struct FunctionParameter final : public Parameter<T>
y
=
coords
[
1
];
y
=
coords
[
1
];
z
=
coords
[
2
];
z
=
coords
[
2
];
}
}
else
if
(
pos
.
getNodeID
())
{
auto
const
&
node
=
*
ParameterBase
::
_mesh
->
getNode
(
pos
.
getNodeID
().
get
());
x
=
node
[
0
];
y
=
node
[
1
];
z
=
node
[
2
];
}
for
(
unsigned
i
=
0
;
i
<
_vec_expression
.
size
();
i
++
)
for
(
unsigned
i
=
0
;
i
<
_vec_expression
.
size
();
i
++
)
{
{
...
@@ -118,7 +105,6 @@ private:
...
@@ -118,7 +105,6 @@ private:
};
};
std
::
unique_ptr
<
ParameterBase
>
createFunctionParameter
(
std
::
unique_ptr
<
ParameterBase
>
createFunctionParameter
(
std
::
string
const
&
name
,
BaseLib
::
ConfigTree
const
&
config
,
std
::
string
const
&
name
,
BaseLib
::
ConfigTree
const
&
config
);
MeshLib
::
Mesh
const
&
mesh
);
}
// namespace ParameterLib
}
// namespace ParameterLib
This diff is collapsed.
Click to expand it.
ParameterLib/Parameter.cpp
+
1
−
1
View file @
1d8d8db0
...
@@ -59,7 +59,7 @@ std::unique_ptr<ParameterBase> createParameter(
...
@@ -59,7 +59,7 @@ std::unique_ptr<ParameterBase> createParameter(
if
(
type
==
"Function"
)
if
(
type
==
"Function"
)
{
{
INFO
(
"FunctionParameter: {:s}"
,
name
);
INFO
(
"FunctionParameter: {:s}"
,
name
);
return
createFunctionParameter
(
name
,
config
,
mesh
);
return
createFunctionParameter
(
name
,
config
);
}
}
if
(
type
==
"Group"
)
if
(
type
==
"Group"
)
{
{
...
...
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