Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F99387348
shape_igfem.cc
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jan 24, 02:36
Size
3 KB
Mime Type
text/x-c
Expires
Sun, Jan 26, 02:36 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
23772926
Attached To
rAKA akantu
shape_igfem.cc
View Options
/**
* @file shape_igfem_inline_impl.cc
*
* @author Aurelia Isabel Cuba Ramos <aurelia.cubaramos@epfl.ch>
*
*
* @brief ShapeIGFEM inline implementation
*
* @section LICENSE
*
* Copyright (©) 2010-2012, 2014 EPFL (Ecole Polytechnique Fédérale de Lausanne)
* Laboratory (LSMS - Laboratoire de Simulation en Mécanique des Solides)
*
*/
/* -------------------------------------------------------------------------- */
#include "aka_memory.hh"
//#include "mesh.hh"
#include "shape_igfem.hh"
/* -------------------------------------------------------------------------- */
#if defined(AKANTU_IGFEM)
__BEGIN_AKANTU__
/* -------------------------------------------------------------------------- */
ShapeLagrange
<
_ek_igfem
>::
ShapeLagrange
(
const
Mesh
&
mesh
,
const
ID
&
id
,
const
MemoryID
&
memory_id
)
:
ShapeFunctions
(
mesh
,
id
,
memory_id
),
shapes
(
"shapes_generic"
,
id
,
memory_id
),
shapes_derivatives
(
"shapes_derivatives_generic"
,
id
,
memory_id
),
igfem_integration_points
(
"igfem_integration_points"
,
id
,
memory_id
),
shapes_at_enrichments
(
"shapes_at_enrichments"
,
id
,
memory_id
)
{
AKANTU_DEBUG_IN
();
AKANTU_DEBUG_OUT
();
}
/*-------------------------------------------------------------------------- */
void
ShapeLagrange
<
_ek_igfem
>::
extractValuesAtStandardNodes
(
const
Array
<
Real
>
&
nodal_values
,
Array
<
Real
>
&
extracted_values
,
const
GhostType
&
ghost_type
)
const
{
AKANTU_DEBUG_ASSERT
(
nodal_values
.
getNbComponent
()
==
extracted_values
.
getNbComponent
(),
"The arrays are not of the same size!!!!!"
);
extracted_values
.
clear
();
UInt
spatial_dimension
=
mesh
.
getSpatialDimension
();
Mesh
::
type_iterator
it
=
mesh
.
firstType
(
spatial_dimension
,
ghost_type
,
_ek_igfem
);
Mesh
::
type_iterator
end
=
mesh
.
lastType
(
spatial_dimension
,
ghost_type
,
_ek_igfem
);
for
(;
it
!=
end
;
++
it
)
{
ElementType
type
=
*
it
;
UInt
nb_elements
=
mesh
.
getNbElement
(
type
,
ghost_type
);
UInt
nb_parent_nodes
=
0
;
UInt
nb_nodes_per_element
=
0
;
#define GET_NODES_INFO(type) \
const ElementType parent_type = ElementClassProperty<type>::parent_element_type; \
nb_parent_nodes = ElementClass<parent_type>::getNbNodesPerInterpolationElement(); \
nb_nodes_per_element = ElementClass<type>::getNbNodesPerInterpolationElement();
AKANTU_BOOST_IGFEM_ELEMENT_SWITCH
(
GET_NODES_INFO
);
#undef GET_NODES_INFO
UInt
*
conn_val
=
mesh
.
getConnectivity
(
type
,
ghost_type
).
storage
();
for
(
UInt
e
=
0
;
e
<
nb_elements
;
++
e
)
{
/// copy the value at standard nodes
UInt
offset
=
e
*
nb_nodes_per_element
;
for
(
UInt
n
=
0
;
n
<
nb_parent_nodes
;
++
n
)
{
UInt
node
=
conn_val
[
offset
+
n
];
for
(
UInt
i
=
0
;
i
<
nodal_values
.
getNbComponent
();
++
i
)
extracted_values
(
node
,
i
)
=
nodal_values
(
node
,
i
);
}
}
}
}
/* -------------------------------------------------------------------------- */
void
ShapeLagrange
<
_ek_igfem
>::
printself
(
std
::
ostream
&
stream
,
int
indent
)
const
{
std
::
string
space
;
for
(
Int
i
=
0
;
i
<
indent
;
i
++
,
space
+=
AKANTU_INDENT
);
stream
<<
space
<<
"Shapes Lagrange ["
<<
std
::
endl
;
ShapeFunctions
::
printself
(
stream
,
indent
+
1
);
shapes
.
printself
(
stream
,
indent
+
1
);
shapes_derivatives
.
printself
(
stream
,
indent
+
1
);
stream
<<
space
<<
"]"
<<
std
::
endl
;
}
__END_AKANTU__
#endif
Event Timeline
Log In to Comment