Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
c33d3d5e
Commit
c33d3d5e
authored
Apr 05, 2016
by
GILLES Sebastien
Browse files
#9
-
#882
Boundary conditions: introduce sub namespace BoundaryConditionNS within Internal.
parent
530539f4
Changes
29
Hide whitespace changes
Inline
Side-by-side
Sources/FiniteElement/BoundaryConditions/DirichletBoundaryCondition.cpp
View file @
c33d3d5e
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
name_
(
name
),
domain_
(
domain
),
unknown_
(
unknown
),
component_manager_
(
Internal
::
ComponentFactory
::
GetInstance
().
CreateFromName
(
component
)),
component_manager_
(
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
GetInstance
().
CreateFromName
(
component
)),
value_per_component_
(
value_per_component
),
processor_wise_method_
(
may_overlap
?
processor_wise_method
::
brute_force
:
processor_wise_method
::
fast
)
# ifndef NDEBUG
...
...
Sources/FiniteElement/BoundaryConditions/DirichletBoundaryCondition.hpp
View file @
c33d3d5e
...
...
@@ -227,7 +227,7 @@ namespace HappyHeart
*
* \return Component manager.
*/
const
Internal
::
ComponentManager
&
GetComponentManager
()
const
noexcept
;
const
Internal
::
BoundaryConditionNS
::
ComponentManager
&
GetComponentManager
()
const
noexcept
;
/*!
...
...
@@ -285,7 +285,7 @@ namespace HappyHeart
const
Unknown
&
unknown_
;
//! Object which can tell which components are encompassed by the boundary condition.
Internal
::
ComponentManager
::
const_shared_ptr
component_manager_
=
nullptr
;
Internal
::
BoundaryConditionNS
::
ComponentManager
::
const_shared_ptr
component_manager_
=
nullptr
;
/*!
* \brief Initial values associated to each dof.
...
...
Sources/FiniteElement/BoundaryConditions/DirichletBoundaryCondition.hxx
View file @
c33d3d5e
...
...
@@ -16,7 +16,8 @@ namespace HappyHeart
}
inline
const
Internal
::
ComponentManager
&
DirichletBoundaryCondition
::
GetComponentManager
()
const
noexcept
inline
const
Internal
::
BoundaryConditionNS
::
ComponentManager
&
DirichletBoundaryCondition
::
GetComponentManager
()
const
noexcept
{
assert
(
!
(
!
component_manager_
));
return
*
component_manager_
;
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp1.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp1
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp1
>
(
Create
);
}
// anonymous namespace
...
...
@@ -50,7 +51,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp1.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp1
final
:
public
Internal
::
TComponentManager
<
Comp1
>
struct
Comp1
final
:
public
TComponentManager
<
Comp1
>
{
/*!
...
...
@@ -61,7 +61,7 @@ namespace HappyHeart
};
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp12.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp12
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp12
>
(
Create
);
}
// anonymous namespace
...
...
@@ -49,7 +50,7 @@ namespace HappyHeart
Comp12
::
Comp12
()
=
default
;
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp12.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp12
final
:
public
Internal
::
TComponentManager
<
Comp12
>
struct
Comp12
final
:
public
TComponentManager
<
Comp12
>
{
/*!
...
...
@@ -61,7 +61,7 @@ namespace HappyHeart
};
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp123.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp123
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp123
>
(
Create
);
}
// anonymous namespace
...
...
@@ -50,7 +51,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp123.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp123
final
:
public
Internal
::
TComponentManager
<
Comp123
>
struct
Comp123
final
:
public
TComponentManager
<
Comp123
>
{
/*!
...
...
@@ -63,7 +63,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp13.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp13
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp13
>
(
Create
);
}
// anonymous namespace
...
...
@@ -50,7 +51,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp13.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp13
final
:
public
Internal
::
TComponentManager
<
Comp13
>
struct
Comp13
final
:
public
TComponentManager
<
Comp13
>
{
/*!
...
...
@@ -63,7 +63,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp2.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp2
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp2
>
(
Create
);
}
// anonymous namespace
...
...
@@ -50,7 +51,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp2.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp2
final
:
public
Internal
::
TComponentManager
<
Comp2
>
struct
Comp2
final
:
public
TComponentManager
<
Comp2
>
{
/*!
...
...
@@ -63,7 +63,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp23.cpp
View file @
c33d3d5e
...
...
@@ -22,7 +22,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -40,7 +40,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp23
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp23
>
(
Create
);
}
// anonymous namespace
...
...
@@ -51,7 +52,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp23.hpp
View file @
c33d3d5e
...
...
@@ -27,7 +27,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -40,7 +40,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp23
final
:
public
Internal
::
TComponentManager
<
Comp23
>
struct
Comp23
final
:
public
TComponentManager
<
Comp23
>
{
/*!
...
...
@@ -63,7 +63,7 @@ namespace HappyHeart
};
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp3.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -39,7 +39,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp3
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
Comp3
>
(
Create
);
}
// anonymous namespace
...
...
@@ -50,7 +51,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/Comp3.hpp
View file @
c33d3d5e
...
...
@@ -25,7 +25,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
Comp3
final
:
public
Internal
::
TComponentManager
<
Comp3
>
struct
Comp3
final
:
public
TComponentManager
<
Comp3
>
{
/*!
...
...
@@ -63,7 +63,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/CompNA.cpp
View file @
c33d3d5e
...
...
@@ -21,7 +21,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -38,7 +38,8 @@ namespace HappyHeart
// Register the geometric element in the 'ComponentFactory' singleton.
// The return value is mandatory: we can't simply call a void function outside function boundaries
// See "Modern C++ Design", Chapter 8, P205.
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
CompNA
>
(
Create
);
__attribute__
((
unused
))
const
bool
registered
=
Internal
::
BoundaryConditionNS
::
ComponentFactory
::
CreateOrGetInstance
().
Register
<
CompNA
>
(
Create
);
}
// anonymous namespace
...
...
@@ -49,7 +50,7 @@ namespace HappyHeart
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/Component/CompNA.hpp
View file @
c33d3d5e
...
...
@@ -24,7 +24,7 @@ namespace HappyHeart
{
namespace
Component
NS
namespace
BoundaryCondition
NS
{
...
...
@@ -37,7 +37,7 @@ namespace HappyHeart
* the derived classes are designed to be very lightweight and add no additional functionalities...)
*
*/
struct
CompNA
final
:
public
Internal
::
TComponentManager
<
CompNA
>
struct
CompNA
final
:
public
TComponentManager
<
CompNA
>
{
/*!
...
...
@@ -60,7 +60,7 @@ namespace HappyHeart
};
}
// namespace
Component
NS
}
// namespace
BoundaryCondition
NS
}
// namespace Internal
...
...
Sources/FiniteElement/BoundaryConditions/Internal/ComponentFactory.cpp
View file @
c33d3d5e
//! \file
//! \file
//
//
// ComponentFactory.cpp
...
...
@@ -24,30 +24,35 @@ namespace HappyHeart
{
const
std
::
string
&
ComponentFactory
::
ClassName
()
namespace
BoundaryConditionNS
{
static
std
::
string
ret
(
"ComponentFactory"
);
return
ret
;
}
ComponentFactory
::
ComponentFactory
()
=
default
;
ComponentManager
::
const_shared_ptr
ComponentFactory
::
CreateFromName
(
const
std
::
string
&
component_name
)
const
{
auto
it
=
callbacks_
.
find
(
component_name
);
if
(
it
==
callbacks_
.
cend
())
throw
ExceptionNS
::
Factory
::
UnregisteredName
(
component_name
,
"component"
,
__FILE__
,
__LINE__
);
ComponentManager
::
const_shared_ptr
ret
=
it
->
second
();
const
std
::
string
&
ComponentFactory
::
ClassName
()
{
static
std
::
string
ret
(
"ComponentFactory"
);
return
ret
;
}
return
ret
;
}
ComponentFactory
::
ComponentFactory
()
=
default
;
ComponentManager
::
const_shared_ptr
ComponentFactory
::
CreateFromName
(
const
std
::
string
&
component_name
)
const
{
auto
it
=
callbacks_
.
find
(
component_name
);
if
(
it
==
callbacks_
.
cend
())
throw
ExceptionNS
::
Factory
::
UnregisteredName
(
component_name
,
"component"
,
__FILE__
,
__LINE__
);
ComponentManager
::
const_shared_ptr
ret
=
it
->
second
();
return
ret
;
}
}
// namespace BoundaryConditionNS
}
// namespace Internal
...
...
Prev
1
2
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment