Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-fufem
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
Ansgar Burchardt
dune-fufem
Commits
784e44b2
Commit
784e44b2
authored
13 years ago
by
Elias Pipping
Committed by
pipping
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Use template specialisation
[[Imported from SVN: r4672]]
parent
09d009e8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dune/fufem/mechanics/tetratensor.hh
+16
-13
16 additions, 13 deletions
dune/fufem/mechanics/tetratensor.hh
with
16 additions
and
13 deletions
dune/fufem/mechanics/tetratensor.hh
+
16
−
13
View file @
784e44b2
...
...
@@ -8,19 +8,19 @@
*/
template
<
int
dim
>
class
TetraTensor
:
public
ElasticityTensor
<
dim
>
class
TetraTensor
;
template
<
>
class
TetraTensor
<
3
>
:
public
ElasticityTensor
<
3
>
{
public:
/** \brief constructor for elasticity tensors with tetragonal symmetry
/** \brief constructor for elasticity tensors with tetragonal symmetry
*
* Parameters are named according to Voigt notation
*/
TetraTensor
(
double
C11
,
double
C12
,
double
C13
,
double
C33
,
double
C44
,
double
C66
)
{
if
(
dim
!=
3
)
DUNE_THROW
(
Dune
::
Exception
,
"Parameters given for a 3-dim tetragonal elasticity tensor but dim!=3"
);
ElasticityTensor
<
dim
>::
operator
=
(
0.0
);
ElasticityTensor
<
3
>::
operator
=
(
0.0
);
(
*
this
)[
0
][
0
]
=
C11
;
(
*
this
)[
1
][
1
]
=
C11
;
...
...
@@ -36,14 +36,19 @@ class TetraTensor : public ElasticityTensor<dim>
(
*
this
)[
2
][
0
]
=
C13
;
(
*
this
)[
2
][
1
]
=
C13
;
}
};
/** \brief for computations in 2 dimensions - the tetragonal symmetry can of course not be represented in 2D */
template
<
>
class
TetraTensor
<
2
>
:
public
ElasticityTensor
<
2
>
{
public:
/** \brief for computations in 2 dimensions - the tetragonal symmetry can of course not be represented in 2D
*
* Parameters are named according to Voigt notation
*/
TetraTensor
(
double
C11
,
double
C22
,
double
C33
,
double
C12
)
{
if
(
dim
!=
2
)
DUNE_THROW
(
Dune
::
Exception
,
"Parameters given for a 2-dim tetragonal elasticity tensor but dim!=2"
);
ElasticityTensor
<
dim
>::
operator
=
(
0.0
);
ElasticityTensor
<
2
>::
operator
=
(
0.0
);
(
*
this
)[
0
][
0
]
=
C11
;
(
*
this
)[
1
][
1
]
=
C22
;
...
...
@@ -52,8 +57,6 @@ class TetraTensor : public ElasticityTensor<dim>
(
*
this
)[
0
][
1
]
=
C12
;
(
*
this
)[
1
][
0
]
=
C12
;
}
};
#endif
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