Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
MoReFEM
CoreLibrary
MoReFEM
Commits
c6d2bd48
Commit
c6d2bd48
authored
Mar 18, 2016
by
Gautier Bureau
Committed by
GILLES Sebastien
Apr 06, 2016
Browse files
#860
ParamterAtQuadPoint added.
parent
871abcd7
Changes
31
Hide whitespace changes
Inline
Side-by-side
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor.hpp
View file @
c6d2bd48
...
...
@@ -87,6 +87,8 @@ namespace HappyHeart
typename
ActiveStressPolicyT
::
local_policy
>
;
using
InputActiveStressPolicyType
=
typename
ActiveStressPolicyT
::
local_policy
::
input_active_stress_policy_type
;
//! Returns the name of the operator.
static
const
std
::
string
&
ClassName
();
...
...
@@ -117,7 +119,7 @@ namespace HappyHeart
* Must be equal or higher than felt_space_dimension.
* \param[in] solid Object which provides the required material parameters for the solid.
* \param[in] time_manager Time manager need for Viscoelasticity and Active Stress.
* \param[in]
match_dof_in_numbering_subset_operator
Object required only for Active Stress to compute U0 and U1 locally.
* \param[in]
input_active_stress_policy
Object required only for Active Stress to compute U0 and U1 locally.
*/
explicit
SecondPiolaKirchhoffStressTensor
(
const
FEltSpace
&
felt_space
,
const
Unknown
&
vectorial_unknown
,
...
...
@@ -125,7 +127,7 @@ namespace HappyHeart
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
Solid
&
solid
,
const
TimeManager
&
time_manager
,
const
MatchDofInNumberingSubset
*
match_dof_in_numbering_subset_operator
=
nullptr
);
InputActiveStressPolicyType
*
input_active_stress_policy
=
nullptr
);
//! Destructor.
~
SecondPiolaKirchhoffStressTensor
()
=
default
;
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor.hxx
View file @
c6d2bd48
...
...
@@ -28,7 +28,7 @@ namespace HappyHeart
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
Solid
&
solid
,
const
TimeManager
&
time_manager
,
const
MatchDofInNumberingSubset
*
match_dof_in_numbering_subset_operator
)
InputActiveStressPolicyType
*
input_active_stress_policy
)
:
parent
(
felt_space
,
vectorial_unknown
,
geom_mesh_region_dimension
,
...
...
@@ -36,8 +36,9 @@ namespace HappyHeart
AllocateGradientFEltPhi
::
yes
,
DoComputeProcessorWiseLocal2Global
::
yes
,
solid
,
time_manager
),
match_dof_in_numbering_subset_operator_
(
match_dof_in_numbering_subset_operator
)
time_manager
,
input_active_stress_policy
),
match_dof_in_numbering_subset_operator_
(
SecondPiolaKirchhoffStressTensorNS
::
Private
::
GetMatchDofInNumberingSubsetOperator
<
InputActiveStressPolicyType
>::
Perform
(
input_active_stress_policy
))
{
assert
(
vectorial_unknown
.
GetNature
()
==
UnknownNS
::
Nature
::
vectorial
);
...
...
@@ -52,12 +53,12 @@ namespace HappyHeart
const
auto
&
active_stress_ptr
=
static_cast
<
ActiveStressPolicyT
*>
(
this
);
auto
&
active_stress
=
*
active_stress_ptr
;
SecondPiolaKirchhoffStressTensorNS
::
Private
::
Initialize
SigmaC
<
ActiveStressPolicyT
>::
Perform
(
mesh
,
quadrature_rule_per_topology
,
initial_value
,
time_manager
,
local_operator_storage
,
active_stress
);
SecondPiolaKirchhoffStressTensorNS
::
Private
::
Initialize
ActivePolicy
<
ActiveStressPolicyT
>::
Perform
(
mesh
,
quadrature_rule_per_topology
,
initial_value
,
time_manager
,
local_operator_storage
,
active_stress
);
}
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestressFiber.hpp
View file @
c6d2bd48
...
...
@@ -88,11 +88,11 @@ namespace HappyHeart
//! Initialize Sigma_c.
template
<
class
LocalOperatorStorageT
>
void
Initialize
SigmaC
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
);
void
Initialize
ActivePolicy
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
);
private:
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/AnalyticalPrestressFiber.hxx
View file @
c6d2bd48
...
...
@@ -30,11 +30,11 @@ namespace HappyHeart
template
<
unsigned
int
FiberIndexT
>
template
<
class
LocalOperatorStorageT
>
void
AnalyticalPrestressFiber
<
FiberIndexT
>::
Initialize
SigmaC
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
)
void
AnalyticalPrestressFiber
<
FiberIndexT
>::
Initialize
ActivePolicy
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
)
{
sigma_c_
=
std
::
make_unique
<
ParameterAtQuadraturePoint
<
ParameterNS
::
Type
::
scalar
>>
(
"SigmaC"
,
mesh
,
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/None.hpp
View file @
c6d2bd48
...
...
@@ -32,7 +32,6 @@ namespace HappyHeart
namespace
ActiveStressPolicyNS
{
class
None
{
public:
...
...
@@ -48,7 +47,7 @@ namespace HappyHeart
using
unique_ptr
=
std
::
unique_ptr
<
self
>
;
//! Alias to vector of unique pointers.
using
vector_unique_ptr
=
std
::
vector
<
unique_ptr
>
;
using
vector_unique_ptr
=
std
::
vector
<
unique_ptr
>
;
public:
...
...
@@ -78,6 +77,7 @@ namespace HappyHeart
};
}
// namespace ActiveStressPolicyNS
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/Private/PartialSpecialization.hpp
View file @
c6d2bd48
...
...
@@ -15,6 +15,7 @@
# include <vector>
# include "Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/ActiveStressPolicy/None.hpp"
# include "Operators/Miscellaneous/MatchDofInNumberingSubset.hpp"
namespace
HappyHeart
...
...
@@ -34,7 +35,7 @@ namespace HappyHeart
template
<
class
ActiveStressPolicyT
>
struct
Initialize
SigmaC
struct
Initialize
ActivePolicy
{
template
<
class
LocalOperatorStorageT
>
...
...
@@ -49,7 +50,7 @@ namespace HappyHeart
template
<
>
struct
Initialize
SigmaC
<
ActiveStressPolicyNS
::
None
>
struct
Initialize
ActivePolicy
<
ActiveStressPolicyNS
::
None
>
{
template
<
class
LocalOperatorStorageT
>
...
...
@@ -60,6 +61,20 @@ namespace HappyHeart
const
LocalOperatorStorageT
&
local_operator_storage
,
ActiveStressPolicyNS
::
None
&
active_stress
);
};
template
<
class
InputActiveStressPolicyT
>
struct
GetMatchDofInNumberingSubsetOperator
{
static
const
MatchDofInNumberingSubset
*
Perform
(
const
InputActiveStressPolicyT
*
input_active_stress_policy
);
};
template
<
>
struct
GetMatchDofInNumberingSubsetOperator
<
ActiveStressPolicyNS
::
None
::
local_policy
::
input_active_stress_policy_type
>
{
static
const
MatchDofInNumberingSubset
*
Perform
(
const
ActiveStressPolicyNS
::
None
::
local_policy
::
input_active_stress_policy_type
*
input_active_stress_policy
);
};
}
// namespace Private
...
...
Sources/Operators/GlobalVariationalOperatorInstances/NonlinearForm/SecondPiolaKirchhoffStressTensor/Private/PartialSpecialization.hxx
View file @
c6d2bd48
...
...
@@ -30,23 +30,23 @@ namespace HappyHeart
template
<
class
ActiveStressPolicyT
>
template
<
class
LocalOperatorStorageT
>
void
Initialize
SigmaC
<
ActiveStressPolicyT
>::
Perform
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
,
ActiveStressPolicyT
&
active_stress
)
void
Initialize
ActivePolicy
<
ActiveStressPolicyT
>::
Perform
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
const
TimeManager
&
time_manager
,
const
LocalOperatorStorageT
&
local_operator_storage
,
ActiveStressPolicyT
&
active_stress
)
{
active_stress
.
template
Initialize
SigmaC
(
mesh
,
quadrature_rule_per_topology
,
initial_value
,
time_manager
,
local_operator_storage
);
active_stress
.
template
Initialize
ActivePolicy
(
mesh
,
quadrature_rule_per_topology
,
initial_value
,
time_manager
,
local_operator_storage
);
}
template
<
class
LocalOperatorStorageT
>
void
Initialize
SigmaC
<
ActiveStressPolicyNS
::
None
>
void
Initialize
ActivePolicy
<
ActiveStressPolicyNS
::
None
>
::
Perform
(
const
GeometricMeshRegion
&
mesh
,
const
quadrature_rule_per_topology_type
&
quadrature_rule_per_topology
,
const
double
initial_value
,
...
...
@@ -61,6 +61,23 @@ namespace HappyHeart
static_cast
<
void
>
(
local_operator_storage
);
static_cast
<
void
>
(
active_stress
);
}
template
<
class
InputActiveStressPolicyT
>
const
MatchDofInNumberingSubset
*
GetMatchDofInNumberingSubsetOperator
<
InputActiveStressPolicyT
>
::
Perform
(
const
InputActiveStressPolicyT
*
input_active_stress_policy
)
{
return
input_active_stress_policy
->
GetMatchDofInNumberingSubsetOperator
();
};
inline
const
MatchDofInNumberingSubset
*
GetMatchDofInNumberingSubsetOperator
<
ActiveStressPolicyNS
::
None
::
local_policy
::
input_active_stress_policy_type
>
::
Perform
(
const
ActiveStressPolicyNS
::
None
::
local_policy
::
input_active_stress_policy_type
*
input_active_stress_policy
)
{
static_cast
<
void
>
(
input_active_stress_policy
);
return
nullptr
;
};
}
// namespace Private
...
...
Sources/Operators/LocalVariationalOperator/Private/GreenLagrangeTensor.cpp
0 → 100644
View file @
c6d2bd48
//
// GreenLagrangeTensor.cpp
// HappyHeart
//
// Created by Gautier Bureau on 16/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#include "Utilities/Numeric/Numeric.hpp"
#include "Operators/LocalVariationalOperator/Private/GreenLagrangeTensor.hpp"
namespace
HappyHeart
{
namespace
LocalVariationalOperatorNS
{
namespace
Private
{
GreenLagrangeTensor
::
GreenLagrangeTensor
(
unsigned
int
mesh_dimension
)
:
mesh_dimension_
(
mesh_dimension
)
{
auto
&
vector
=
GetNonCstVector
();
switch
(
mesh_dimension
)
{
case
2u
:
vector
.
Resize
(
3
);
break
;
case
3u
:
vector
.
Resize
(
6
);
break
;
default:
assert
(
false
&&
"Only implemented for dimensions 2 and 3."
);
exit
(
EXIT_FAILURE
);
}
}
namespace
// anonymous
{
void
Update2D
(
const
CauchyGreenTensor
&
cauchy_green_tensor
,
LocalVector
&
result
);
void
Update3D
(
const
CauchyGreenTensor
&
cauchy_green_tensor
,
LocalVector
&
result
);
}
// namespace anonymous
const
LocalVector
&
GreenLagrangeTensor
::
Update
(
const
CauchyGreenTensor
&
cauchy_green_tensor
)
{
const
auto
mesh_dimension
=
GetMeshDimension
();
auto
&
ret
=
GetNonCstVector
();
switch
(
mesh_dimension
)
{
case
2u
:
Update2D
(
cauchy_green_tensor
,
ret
);
return
ret
;
case
3u
:
Update3D
(
cauchy_green_tensor
,
ret
);
return
ret
;
default:
assert
(
false
&&
"Only implemented for dimensions 2 and 3."
);
exit
(
EXIT_FAILURE
);
}
}
namespace
// anonymous
{
void
Update2D
(
const
CauchyGreenTensor
&
cauchy_green_tensor
,
LocalVector
&
result
)
{
assert
(
result
.
GetM
()
==
3
);
result
(
0
)
=
0.5
*
(
cauchy_green_tensor
.
xx
()
-
1.
);
result
(
1
)
=
0.5
*
(
cauchy_green_tensor
.
yy
()
-
1.
);
result
(
2
)
=
cauchy_green_tensor
.
xy
();
}
void
Update3D
(
const
CauchyGreenTensor
&
cauchy_green_tensor
,
LocalVector
&
result
)
{
assert
(
result
.
GetM
()
==
6
);
result
(
0
)
=
0.5
*
(
cauchy_green_tensor
.
xx
()
-
1.
);
result
(
1
)
=
0.5
*
(
cauchy_green_tensor
.
yy
()
-
1.
);
result
(
2
)
=
0.5
*
(
cauchy_green_tensor
.
zz
()
-
1.
);
result
(
3
)
=
cauchy_green_tensor
.
xy
();
result
(
4
)
=
cauchy_green_tensor
.
yz
();
result
(
5
)
=
cauchy_green_tensor
.
xz
();
}
}
// namespace anonymous
}
// namespace Private
}
// namespace LocalVariationalOperatorNS
}
// namespace HappyHeart
Sources/Operators/LocalVariationalOperator/Private/GreenLagrangeTensor.hpp
0 → 100644
View file @
c6d2bd48
//
// GreenLagrangeTensor.hpp
// HappyHeart
//
// Created by Gautier Bureau on 16/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_GREEN_LAGRANGE_TENSOR_HPP_
# define HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_GREEN_LAGRANGE_TENSOR_HPP_
# include <memory>
# include <vector>
# include <array>
# include "Utilities/MatrixOrVector.hpp"
#include "Operators/LocalVariationalOperator/Private/CauchyGreenTensor.hpp"
namespace
HappyHeart
{
namespace
LocalVariationalOperatorNS
{
namespace
Private
{
/*!
* \brief Class in charge of computing Cauchy-Green tensor.
*/
class
GreenLagrangeTensor
final
{
public:
//! Alias to unique pointer.
using
unique_ptr
=
std
::
unique_ptr
<
GreenLagrangeTensor
>
;
public:
//! Constructor.
explicit
GreenLagrangeTensor
(
unsigned
int
mesh_dimension
);
//! Destructor.
~
GreenLagrangeTensor
()
=
default
;
//! Copy constructor.
GreenLagrangeTensor
(
const
GreenLagrangeTensor
&
)
=
delete
;
//! Move constructor.
GreenLagrangeTensor
(
GreenLagrangeTensor
&&
)
=
default
;
//! Copy affectation.
GreenLagrangeTensor
&
operator
=
(
const
GreenLagrangeTensor
&
)
=
delete
;
//! Move affectation.
GreenLagrangeTensor
&
operator
=
(
GreenLagrangeTensor
&&
)
=
delete
;
//! Update the values.
const
LocalVector
&
Update
(
const
CauchyGreenTensor
&
cauchy_green_tensor
);
private:
//! Dimension of the mesh considered.
unsigned
int
GetMeshDimension
()
const
noexcept
;
/*!
* \brief Access to the matrix.
*
* \internal This one is at the moment private because all uses are currently covered by Update().
*/
const
LocalVector
&
GetVector
()
const
noexcept
;
//! Non constant access to the matrix.
LocalVector
&
GetNonCstVector
()
noexcept
;
private:
//! Mesh dimension.
const
unsigned
int
mesh_dimension_
;
//! The matrix.
LocalVector
vector_
;
};
}
// namespace Private
}
// namespace LocalVariationalOperatorNS
}
// namespace HappyHeart
#include "Operators/LocalVariationalOperator/Private/GreenLagrangeTensor.hxx"
#endif // HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_GREEN_LAGRANGE_TENSOR_HPP_
Sources/Operators/LocalVariationalOperator/Private/GreenLagrangeTensor.hxx
0 → 100644
View file @
c6d2bd48
//
// GreenLagrangeTensor.hxx
// HappyHeart
//
// Created by Gautier Bureau on 16/03/15.
// Copyright (c) 2015 Inria. All rights reserved.
//
#ifndef HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_GREEN_LAGRANGE_TENSOR_HXX_
# define HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_GREEN_LAGRANGE_TENSOR_HXX_
namespace
HappyHeart
{
namespace
LocalVariationalOperatorNS
{
namespace
Private
{
inline
unsigned
int
GreenLagrangeTensor
::
GetMeshDimension
()
const
noexcept
{
assert
(
mesh_dimension_
==
2u
||
mesh_dimension_
==
3u
);
return
mesh_dimension_
;
}
inline
const
LocalVector
&
GreenLagrangeTensor
::
GetVector
()
const
noexcept
{
return
vector_
;
}
inline
LocalVector
&
GreenLagrangeTensor
::
GetNonCstVector
()
noexcept
{
return
const_cast
<
LocalVector
&>
(
GetVector
());
}
}
// namespace Private
}
// namespace LocalVariationalOperatorNS
}
// namespace HappyHeart
#endif // HAPPY_HEART_x_OPERATORS_x_LOCAL_VARIATIONAL_OPERATOR_x_PRIVATE_x_CAUCHY_GREEN_TENSOR_HXX_
Sources/Operators/LocalVariationalOperatorInstances/NonlinearForm/NonLinearSource/ReactionLaw/Instantiations/CourtemancheRamirezNattel.hpp
View file @
c6d2bd48
...
...
@@ -153,11 +153,11 @@ namespace HappyHeart
private:
std
::
array
<
Scalar
ParameterAtQuad
Pt
::
unique_ptr
,
30
>
parameter_list_
;
std
::
array
<
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
::
unique_ptr
,
30
>
parameter_list_
;
Scalar
ParameterAtQuad
Pt
&
GetNonCstParameter
(
parameter_index
index
)
noexcept
;
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
&
GetNonCstParameter
(
parameter_index
index
)
noexcept
;
const
Scalar
ParameterAtQuad
Pt
&
GetParameter
(
parameter_index
index
)
const
noexcept
;
const
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
&
GetParameter
(
parameter_index
index
)
const
noexcept
;
private:
...
...
Sources/Operators/LocalVariationalOperatorInstances/NonlinearForm/NonLinearSource/ReactionLaw/Instantiations/CourtemancheRamirezNattel.hxx
View file @
c6d2bd48
...
...
@@ -276,7 +276,7 @@ namespace HappyHeart
inline
ReactionLaw
<
ReactionLawName
::
CourtemancheRamirezNattel
>::
ScalarParameterAtQuadPt
&
ReactionLaw
<
ReactionLawName
::
CourtemancheRamirezNattel
>::
GetNonCstParameter
(
parameter_index
index
)
noexcept
{
return
const_cast
<
Scalar
ParameterAtQuad
Pt
&>
(
GetParameter
(
index
));
return
const_cast
<
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
&>
(
GetParameter
(
index
));
}
...
...
Sources/Operators/LocalVariationalOperatorInstances/NonlinearForm/NonLinearSource/ReactionLaw/Instantiations/FitzHughNagumo.hpp
View file @
c6d2bd48
...
...
@@ -125,14 +125,14 @@ namespace HappyHeart
double
GetC
()
const
noexcept
;
Scalar
ParameterAtQuad
Pt
&
GetNonCstGate
()
noexcept
;
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
&
GetNonCstGate
()
noexcept
;
const
Scalar
ParameterAtQuad
Pt
&
GetGate
()
const
noexcept
;
const
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
&
GetGate
()
const
noexcept
;
private:
//! Gate.
Scalar
ParameterAtQuad
Pt
::
unique_ptr
gate_
=
nullptr
;
ParameterAtQuad
aturePoint
<
ParameterNS
::
Type
::
scalar
>
::
unique_ptr
gate_
=
nullptr
;
private:
...
...
Sources/Operators/LocalVariationalOperatorInstances/NonlinearForm/NonLinearSource/ReactionLaw/Instantiations/FitzHughNagumo.hxx
View file @
c6d2bd48
...
...
@@ -36,11 +36,11 @@ namespace HappyHeart
const