Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
dynamic
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
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
MostafaMollaali
dynamic
Commits
b69b5acd
Commit
b69b5acd
authored
9 years ago
by
Christoph Lehmann
Browse files
Options
Downloads
Patches
Plain Diff
FIX Segfault
change from pointer to unique_ptr fixes segfault.
parent
f7bc14c6
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
ProcessLib/ProcessVariable.cpp
+2
-14
2 additions, 14 deletions
ProcessLib/ProcessVariable.cpp
ProcessLib/ProcessVariable.h
+7
-7
7 additions, 7 deletions
ProcessLib/ProcessVariable.h
with
9 additions
and
21 deletions
ProcessLib/ProcessVariable.cpp
+
2
−
14
View file @
b69b5acd
...
@@ -42,8 +42,7 @@ ProcessVariable::ProcessVariable(
...
@@ -42,8 +42,7 @@ ProcessVariable::ProcessVariable(
config
.
get
<
std
::
string
>
(
"initial_condition.type"
);
config
.
get
<
std
::
string
>
(
"initial_condition.type"
);
if
(
type
==
"Uniform"
)
if
(
type
==
"Uniform"
)
{
{
_initial_condition
=
_initial_condition
.
reset
(
new
UniformInitialCondition
(
ic_config
->
second
));
new
UniformInitialCondition
(
ic_config
->
second
);
}
}
else
else
{
{
...
@@ -96,17 +95,6 @@ ProcessVariable::ProcessVariable(
...
@@ -96,17 +95,6 @@ ProcessVariable::ProcessVariable(
}
}
}
}
ProcessVariable
::~
ProcessVariable
()
{
delete
_initial_condition
;
for
(
auto
p
:
_dirichlet_bcs
)
delete
p
;
for
(
auto
p
:
_neumann_bc_configs
)
delete
p
;
}
std
::
string
const
&
ProcessVariable
::
getName
()
const
std
::
string
const
&
ProcessVariable
::
getName
()
const
{
{
return
_name
;
return
_name
;
...
@@ -121,7 +109,7 @@ void ProcessVariable::initializeDirichletBCs(
...
@@ -121,7 +109,7 @@ void ProcessVariable::initializeDirichletBCs(
MeshGeoToolsLib
::
MeshNodeSearcher
&
searcher
,
MeshGeoToolsLib
::
MeshNodeSearcher
&
searcher
,
std
::
vector
<
std
::
size_t
>&
global_ids
,
std
::
vector
<
double
>&
values
)
std
::
vector
<
std
::
size_t
>&
global_ids
,
std
::
vector
<
double
>&
values
)
{
{
for
(
UniformDirichletBoundaryCondition
*
bc
:
_dirichlet_bcs
)
for
(
auto
&
bc
:
_dirichlet_bcs
)
bc
->
initialize
(
searcher
,
global_ids
,
values
);
bc
->
initialize
(
searcher
,
global_ids
,
values
);
}
}
...
...
This diff is collapsed.
Click to expand it.
ProcessLib/ProcessVariable.h
+
7
−
7
View file @
b69b5acd
...
@@ -12,7 +12,8 @@
...
@@ -12,7 +12,8 @@
#include
<boost/property_tree/ptree.hpp>
#include
<boost/property_tree/ptree.hpp>
#include
"InitialCondition.h"
#include
"UniformDirichletBoundaryCondition.h"
#include
"NeumannBc.h"
#include
"NeumannBc.h"
namespace
MeshGeoToolsLib
namespace
MeshGeoToolsLib
...
@@ -46,12 +47,11 @@ namespace ProcessLib
...
@@ -46,12 +47,11 @@ namespace ProcessLib
class
ProcessVariable
class
ProcessVariable
{
{
using
ConfigTree
=
boost
::
property_tree
::
ptree
;
using
ConfigTree
=
boost
::
property_tree
::
ptree
;
public:
public:
ProcessVariable
(
ConfigTree
const
&
config
,
MeshLib
::
Mesh
const
&
mesh
,
ProcessVariable
(
ConfigTree
const
&
config
,
MeshLib
::
Mesh
const
&
mesh
,
GeoLib
::
GEOObjects
const
&
geometries
);
GeoLib
::
GEOObjects
const
&
geometries
);
~
ProcessVariable
();
std
::
string
const
&
getName
()
const
;
std
::
string
const
&
getName
()
const
;
/// Returns a mesh on which the process variable is defined.
/// Returns a mesh on which the process variable is defined.
...
@@ -66,7 +66,7 @@ public:
...
@@ -66,7 +66,7 @@ public:
GlobalSetup
const
&
,
GlobalSetup
const
&
,
Args
&&
...
args
)
Args
&&
...
args
)
{
{
for
(
NeumannBcConfig
*
config
:
_neumann_bc_configs
)
for
(
auto
&
config
:
_neumann_bc_configs
)
{
{
config
->
initialize
(
searcher
);
config
->
initialize
(
searcher
);
bcs
=
new
NeumannBc
<
GlobalSetup
>
(
*
config
,
std
::
forward
<
Args
>
(
args
)...);
bcs
=
new
NeumannBc
<
GlobalSetup
>
(
*
config
,
std
::
forward
<
Args
>
(
args
)...);
...
@@ -76,9 +76,9 @@ public:
...
@@ -76,9 +76,9 @@ public:
private
:
private
:
std
::
string
const
_name
;
std
::
string
const
_name
;
MeshLib
::
Mesh
const
&
_mesh
;
MeshLib
::
Mesh
const
&
_mesh
;
InitialCondition
*
_initial_condition
;
std
::
unique_ptr
<
InitialCondition
>
_initial_condition
;
std
::
vector
<
UniformDirichletBoundaryCondition
*
>
_dirichlet_bcs
;
std
::
vector
<
std
::
unique_ptr
<
UniformDirichletBoundaryCondition
>
>
_dirichlet_bcs
;
std
::
vector
<
NeumannBcConfig
*
>
_neumann_bc_configs
;
std
::
vector
<
std
::
unique_ptr
<
NeumannBcConfig
>
>
_neumann_bc_configs
;
};
};
}
// namespace ProcessLib
}
// namespace ProcessLib
...
...
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