50 int nodes, sides, dim, len;
65 for (
int inode = 0; inode < nodes; inode++ ) {
94 static int face_con_ed [ 3 ] [ 2 ] = { { 3, 1 }, { 1, 2 }, { 2, 3 } };
95 static int quad_con_ed [ 4 ] [ 2 ] = { { 4, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 } };
101 static int tetra_con_fc [ 4 ] [ 3 ] = { { 4, 2, 1 }, { 2, 3, 1 }, { 3, 4, 1 }, { 3, 2, 4 } };
102 static int hexa_con_fc [ 8 ] [ 3 ] = { { 5, 2, 1 }, { 2, 3, 1 }, { 3, 4, 1 }, { 4, 5, 1 }, { 2, 5, 6 }, { 3, 2, 6 }, { 4, 3, 6 }, { 5, 4, 6 } };
104 int i, dim, *con = NULL;
124 con = face_con_ed [ inode - 1 ];
128 con = quad_con_ed [ inode - 1 ];
132 con = tetra_con_fc [ inode - 1 ];
136 con = hexa_con_fc [ inode - 1 ];
142 for ( i = 0; i < dim; i++ ) {
152 static int edge_con_nd [ 2 ] = {
164 for (
Dof *dof: *node ) {
165 if ( dof->hasBc(tStep) != 0 ) {
166 nodeBcDofId.
at(++nodeNumBc) = dof->giveDofID();
170 if ( nodeNumBc == 0 ) {
175 sideBcDofId, VM_Total, tStep);
186 static int face_con_nd [ 3 ] [ 2 ] = { { 3, 2 }, { 1, 3 }, { 2, 1 } };
187 static int quad_con_nd [ 4 ] [ 2 ] = { { 4, 2 }, { 1, 3 }, { 2, 4 }, { 3, 1 } };
189 int *con = NULL, iside, nodeNumBc;
197 for (
Dof *dof: *node ) {
198 if ( dof->hasBc(tStep) != 0 ) {
199 nodeBcDofId.
at(++nodeNumBc) = dof->giveDofID();
203 if ( nodeNumBc == 0 ) {
210 con = face_con_nd [ inode - 1 ];
214 con = quad_con_nd [ inode - 1 ];
220 for ( iside = 0; iside < 2; iside++ ) {
222 node, nodeBcDofId, nodeNumBc,
223 sideBcDofIdList[iside],
233 std::vector< IntArray > &faceBcDofIdList,
IntArray &faceNumBc,
TimeStep *tStep)
238 static int tetra_con_nd [ 4 ] [ 3 ] = { { 2, 3, 4 }, { 3, 1, 4 }, { 1, 2, 4 }, { 1, 3, 2 } };
239 static int hexa_con_nd [ 8 ] [ 3 ] = { { 2, 4, 5 }, { 3, 1, 6 }, { 4, 2, 7 }, { 1, 3, 8 }, { 8, 6, 1 }, { 5, 7, 2 }, { 6, 8, 3 }, { 7, 5, 4 } };
245 static int tetra_con_fc [ 4 ] [ 3 ] = { { 4, 2, 1 }, { 2, 3, 1 }, { 3, 4, 1 }, { 3, 2, 4 } };
246 static int hexa_con_fc [ 8 ] [ 3 ] = { { 5, 2, 1 }, { 2, 3, 1 }, { 3, 4, 1 }, { 4, 5, 1 }, { 2, 5, 6 }, { 3, 2, 6 }, { 4, 3, 6 }, { 5, 4, 6 } };
251 static int tetra_fc_nd [ 4 ] [ 3 ] = { { 1, 2, 3 }, { 1, 2, 4 }, { 2, 3, 4 }, { 3, 1, 4 } };
252 static int hexa_fc_nd [ 6 ] [ 4 ] = { { 1, 2, 3, 4 }, { 1, 2, 6, 5 }, { 2, 3, 7, 6 }, { 3, 4, 8, 7 }, { 4, 1, 5, 8 }, { 8, 7, 6, 5 } };
254 int *con = NULL, iside, iface, jnode, nodeNumBc, fcNumBc;
263 for (
Dof *dof: *node ) {
264 if ( dof->hasBc(tStep) != 0 ) {
265 nodeBcDofId.
at(++nodeNumBc) = dof->giveDofID();
269 if ( nodeNumBc == 0 ) {
276 con = tetra_con_nd [ inode - 1 ];
280 con = hexa_con_nd [ inode - 1 ];
286 for ( iside = 0; iside < 3; iside++ ) {
288 node, nodeBcDofId, nodeNumBc,
289 sideBcDofIdList[iside],
291 if ( sideNumBc.
at(iside + 1) != 0 ) {
296 if ( hasBc ==
true ) {
297 faceBcDofId.
resize(nodeNumBc);
303 for (
int i = 0; i < 3; i++ ) {
304 iface = tetra_con_fc [ inode - 1 ] [ i ];
306 for (
int idof = 1; idof <= fcNumBc; idof++ ) {
307 faceBcDofId.
at(idof) = nodeBcDofId.
at(idof);
310 for (
int j = 0; j < 3; j++ ) {
311 jnode = tetra_fc_nd [ iface - 1 ] [ j ];
312 if ( jnode == inode ) {
319 for (
int idof = 1; idof <= fcNumBc; idof++ ) {
320 faceBcDofId.at(idof) = faceBcDofIdList[i].at(idof);
324 faceNumBc.
at(i + 1) = fcNumBc;
331 for (
int i = 0; i < 3; i++ ) {
332 iface = hexa_con_fc [ inode - 1 ] [ i ];
334 for (
int idof = 1; idof <= fcNumBc; idof++ ) {
335 faceBcDofId.
at(idof) = nodeBcDofId.
at(idof);
338 for (
int j = 0; j < 4; j++ ) {
339 jnode = hexa_fc_nd [ iface - 1 ] [ j ];
340 if ( jnode == inode ) {
347 for (
int idof = 1; idof <= fcNumBc; idof++ ) {
348 faceBcDofId.at(idof) = faceBcDofIdList[i].at(idof);
352 faceNumBc.
at(i + 1) = fcNumBc;
369 int iload, loads, bloads;
377 if ( loads / 2 * 2 != loads ) {
383 boundaryLoadArray.
resize(loads);
386 for ( iload = 1; iload <= loads; iload += 2 ) {
387 if ( loadArray->
at(iload + 1) != 1 ) {
392 boundaryLoadArray.
at(bloads - 1) = loadArray->
at(iload);
393 boundaryLoadArray.
at(bloads) = 1;
396 boundaryLoadArray.
resize(bloads);
410 static int face_con_ed [ 3 ] [ 2 ] = { { 3, 1 }, { 1, 2 }, { 2, 3 } };
411 static int quad_con_ed [ 4 ] [ 2 ] = { { 4, 1 }, { 1, 2 }, { 2, 3 }, { 3, 4 } };
413 static int fine_quad_side [ 2 ] = {
417 int iside, iload, loads, bloads, side, *con = NULL;
425 if ( loads / 2 * 2 != loads ) {
434 con = face_con_ed [ inode - 1 ];
438 con = quad_con_ed [ inode - 1 ];
444 for ( iside = 0; iside < 2; iside++ ) {
445 IntArray &boundaryLoadArray = boundaryLoadList[iside];
446 boundaryLoadArray.
resize(loads);
449 side = con [ iside ];
450 for ( iload = 1; iload <= loads; iload += 2 ) {
451 if ( loadArray->
at(iload + 1) != side ) {
456 boundaryLoadArray.
at(bloads - 1) = loadArray->
at(iload);
457 boundaryLoadArray.
at(bloads) = fine_quad_side [ iside ];
460 boundaryLoadArray.
resize(bloads);
475 static int tetra_con_fc [ 4 ] [ 3 ] = { { 4, 2, 1 }, { 2, 3, 1 }, { 3, 4, 1 }, { 3, 2, 4 } };
476 static int hexa_con_fc [ 8 ] [ 3 ] = { { 6, 3, 1 }, { 3, 4, 1 }, { 4, 5, 1 }, { 5, 6, 1 }, { 3, 6, 2 }, { 4, 3, 2 }, { 5, 4, 2 }, { 6, 5, 2 } };
478 static int fine_hexa_side [ 3 ] = {
482 int iside, iload, loads, bloads, side, *con = NULL;
490 if ( loads / 2 * 2 != loads ) {
499 con = tetra_con_fc [ inode - 1 ];
503 con = hexa_con_fc [ inode - 1 ];
509 for ( iside = 0; iside < 3; iside++ ) {
510 IntArray &boundaryLoadArray = boundaryLoadList[iside];
511 boundaryLoadArray.
resize(loads);
514 side = con [ iside ];
515 for ( iload = 1; iload <= loads; iload += 2 ) {
516 if ( loadArray->
at(iload + 1) != side ) {
521 boundaryLoadArray.
at(bloads - 1) = loadArray->
at(iload);
522 boundaryLoadArray.
at(bloads) = fine_hexa_side [ iside ];
525 boundaryLoadArray.
resize(bloads);
536 bool compatibleCS, newLcs, newNodeLcs;
537 double epsilon = 1.0e-9;
543 newLcs = newNodeLcs =
false;
548 if ( Lcs != NULL || nodeLcs != NULL ) {
554 Lcs->
at(1, 1) = Lcs->
at(2, 2) = Lcs->
at(3, 3) = 1.0;
558 if ( nodeLcs == NULL ) {
561 nodeLcs->
at(1, 1) = nodeLcs->
at(2, 2) = nodeLcs->
at(3, 3) = 1.0;
567 if ( newLcs ==
true ) {
571 if ( newNodeLcs ==
true ) {
575 for (
int i = 1; i <= 3; i++ ) {
576 if ( fabs(trFromNodeLcsToLcs.
at(i, i) - 1.0) > epsilon ) {
577 compatibleCS =
false;
585 if ( compatibleCS ==
true ) {
586 for (
int i = 1; i <= dofs; i++ ) {
590 if ( nodeDof->
hasBc(tStep) == false ) {
600 for (
Dof *dof: *master_node ) {
601 if ( dof->hasBc(tStep) == false ) {
605 if ( dof->giveDofID() != dofId ) {
609 if ( dof->giveBcId() == bcId ) {
610 answer.
at(++compDofs) = dofIDArray.
at(i);
614 if ( dof->giveBcValue(mode, tStep) == bcValue ) {
615 answer.
at(++compDofs) = dofIDArray.
at(i);
639 return std :: string(
"RefinedElement::") + func +
", number: " + std::to_string(this->
elementId);
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
FloatMatrix * giveLocalCoordinateTriplet()
Returns pointer to local coordinate triplet in node.
ValueModeType
Type representing the mode of UnknownType or CharType, or similar types.
IntArray * giveFineNodeArray(int node)
Abstract base class for all finite elements.
bool giveBoundaryLoadArray3D(int inode, Element *element, std::vector< IntArray > &boundaryLoadList)
Class implementing an array of integers.
int & at(int i)
Coefficient access function.
virtual int giveNumberOfDofManagers() const
std::string errorInfo(const char *func) const
Returns string for prepending output (used by error reporting macros).
virtual int giveNumberOfNodes() const
Returns number of nodes of receiver.
virtual int giveBcId()=0
Returns the id of associated boundary condition, if there is any.
int giveNumberOfDofs() const
Element * giveElement(int n)
Service for accessing particular domain fe element.
DofIDItem
Type representing particular dof type.
bool giveBcDofArray1D(int inode, Element *element, IntArray &sideBcDofId, int &sideNumBc, TimeStep *tStep)
DofIDItem giveDofID() const
Returns DofID value of receiver, which determines type of of unknown connected to receiver (e...
bool giveBoundaryLoadArray2D(int inode, Element *element, std::vector< IntArray > &boundaryLoadList)
double at(int i, int j) const
Coefficient access function.
void resize(int n)
Checks size of receiver towards requested bounds.
bool giveBcDofArray3D(int inode, Element *element, std::vector< IntArray > &sideBcDofIdList, IntArray &sideNumBc, std::vector< IntArray > &faceBcDofIdList, IntArray &faceNumBc, TimeStep *tStep)
int giveCompatibleBcDofArray(Node *master_node, Node *slave_node, IntArray &dofIDArray, int dofs, IntArray &answer, ValueModeType mode, TimeStep *tStep)
Extract from dofArray of slave_node those Dofs that have compatible BCs with master_node.
virtual int giveNumberOfBoundarySides()
virtual int giveSpatialDimension()
Returns the element spatial dimension (1, 2, or 3).
Implementation of matrix containing floating point numbers.
Dof * giveDofWithID(int dofID) const
Returns DOF with given dofID; issues error if not present.
virtual double giveBcValue(ValueModeType mode, TimeStep *tStep)
Returns value of boundary condition of dof if it is prescribed.
bool giveBcDofArray2D(int inode, Element *element, std::vector< IntArray > &sideBcDofIdList, IntArray &sideNumBc, TimeStep *tStep)
std::vector< IntArray > fineNodeList
void beProductTOf(const FloatMatrix &a, const FloatMatrix &b)
Assigns to the receiver product of .
void zero()
Zeroes all coefficient of receiver.
virtual bool hasBc(TimeStep *tStep)=0
Test if Dof has active boundary condition.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
the oofem namespace is to define a context or scope in which all oofem names are defined.
bool giveBoundaryLoadArray1D(int inode, Element *element, IntArray &boundaryLoadArray)
Class implementing node in finite element mesh.
Abstract class Dof represents Degree Of Freedom in finite element mesh.
Node * giveNode(int i) const
Returns reference to the i-th node of element.
Class representing solution step.
IntArray * giveBoundaryFlagArray(void)
RefinedElement(Domain *d, int elem, int level)