Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Core Modules
dune-common
Commits
1cdd14f7
Commit
1cdd14f7
authored
19 years ago
by
Oliver Sander
Browse files
Options
Downloads
Patches
Plain Diff
You have to provide material parameters to instiantiate the class now
[[Imported from SVN: r4182]]
parent
275b26fc
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
disc/elasticity/linearelasticityassembler.hh
+13
-46
13 additions, 46 deletions
disc/elasticity/linearelasticityassembler.hh
with
13 additions
and
46 deletions
disc/elasticity/linearelasticityassembler.hh
+
13
−
46
View file @
1cdd14f7
...
...
@@ -24,7 +24,7 @@
/**
* @file
* @brief
c
ompute local stiffness matrix for conforming finite elements for linear elasticity equation
* @brief
C
ompute local stiffness matrix for conforming finite elements for linear elasticity equation
* @author Oliver Sander
*/
...
...
@@ -43,11 +43,11 @@ namespace Dune
//! A class for computing local stiffness matrices
/*! A class for computing local stiffness matrix for the
diffusion
equation
linear elasticity
equation
div
j = q; j = -K grad u;
in Omega
-
div
\sigma = f
in Omega
u = g on Gamma1; j*n = J on Gamma2.
u = g on Gamma1; j*n = J on Gamma2.
Uses conforming finite elements with the Lagrange shape functions.
It should work for all dimensions and element types.
...
...
@@ -70,7 +70,6 @@ namespace Dune
// some other sizes
enum
{
dim
=
GridType
::
dimension
};
//enum {SIZE=Dune::LagrangeShapeFunctionSetContainer<DT,RT,dim>::maxsize};
//! The engineers' way of writing a symmetric second-order tensor
typedef
FieldVector
<
double
,
(
dim
+
1
)
*
dim
/
2
>
SymmTensor
;
...
...
@@ -95,13 +94,9 @@ namespace Dune
double
nu_
;
//! Constructor
LinearElasticityLocalStiffness
(
bool
procBoundaryAsDirichlet_
=
true
)
:
E_
(
2.5e5
)
LinearElasticityLocalStiffness
(
double
E
,
double
nu
,
bool
procBoundaryAsDirichlet_
=
true
)
:
E_
(
E
),
nu_
(
nu
)
{
//E_ = 2.5e5;
nu_
=
0.3
;
this
->
currentsize_
=
0
;
procBoundaryAsDirichlet
=
procBoundaryAsDirichlet_
;
...
...
@@ -111,6 +106,13 @@ namespace Dune
this
->
bctype
[
i
]
=
BoundaryConditions
::
neumann
;
}
/** \brief Set material parameters */
void
setEandNu
(
double
E
,
double
nu
)
{
E_
=
E
;
nu_
=
nu
;
}
//! assemble local stiffness matrix for given element and order
/*! On exit the following things have been done:
...
...
@@ -131,10 +133,6 @@ namespace Dune
this
->
currentsize_
=
sfs
.
size
();
// std::cout << "Entity:" << std::endl;
// for (int i=0; i<e.template count<n>(); i++)
// std::cout << "corner i=" << i << " pos=" << e.geometry()[i] << std::endl;
// clear assemble data
for
(
int
i
=
0
;
i
<
sfs
.
size
();
i
++
)
{
...
...
@@ -144,8 +142,6 @@ namespace Dune
this
->
A
[
i
][
j
]
=
0
;
}
// Loop over all quadrature points and assemble matrix and right hand side
// Compute suitable quadrature order
int
p
=
2
;
if
(
gt
.
isSimplex
())
...
...
@@ -165,22 +161,12 @@ namespace Dune
// eval jacobian inverse
const
Dune
::
FieldMatrix
<
DT
,
dim
,
dim
>
jac
=
e
.
geometry
().
jacobianInverseTransposed
(
local
);
#if 0
// eval diffusion tensor
const Dune::FieldMatrix<DT,dim,dim> K = problem.K(global,e,local);
#endif
// weight of quadrature point
double
weight
=
Dune
::
QuadratureRules
<
DT
,
dim
>::
rule
(
gt
,
p
)[
g
].
weight
();
// determinant of jacobian
DT
detjac
=
e
.
geometry
().
integrationElement
(
local
);
#if 0
// Source term;
RT q = problem.q(global,e,local);
#endif
RT
factor
=
weight
*
detjac
;
// evaluate gradients at Gauss points
...
...
@@ -206,7 +192,6 @@ namespace Dune
FieldMatrix
<
double
,
dim
,
dim
>
Grad
(
0
);
Grad
[
k
]
=
grad
[
i
];
//std::cout << Grad << std::endl;
/* Computes the linear strain tensor from the deformation gradient*/
computeStrain
(
Grad
,
strain
[
i
*
dim
+
k
]);
...
...
@@ -225,28 +210,10 @@ namespace Dune
for
(
int
ccomp
=
0
;
ccomp
<
dim
;
ccomp
++
)
{
this
->
A
[
row
][
col
][
rcomp
][
ccomp
]
+=
stress
*
strain
[
col
*
dim
+
ccomp
]
*
weight
*
detjac
;
// printf("adding %g to %d %d %d %d\n", stress*strain[col*dim + ccomp] * weight * detjac,
// row, col, rcomp, ccomp);
}
}
}
#if 0
// rhs
b[i] += q*sfs[i].evaluateFunction(0,local)*factor;
// matrix
gv = 0;
K.umv(grad[i],gv); // multiply with diffusion tensor
A[i][i] += (grad[i]*gv)*factor;
for (int j=0; j<i; j++)
{
RT t = (grad[j]*gv)*factor;
A[i][j] += t;
A[j][i] += t;
}
#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