Skip to content

Commit

Permalink
move function to .h to test CI
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-afeef-badri committed Jan 15, 2025
1 parent 6fd7cb1 commit 319d46a
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 26 deletions.
26 changes: 0 additions & 26 deletions modules/laplace/FemModule.cc
Original file line number Diff line number Diff line change
Expand Up @@ -162,32 +162,6 @@ _assembleLinearOperator()
_printArcaneFemTime("[ArcaneFem-Timer] rhs-vector-assembly", elapsedTime);
}

/*---------------------------------------------------------------------------*/
/**
* @brief Computes the element matrix for a tetrahedral element (P1 FE).
*
* This function calculates the integral of the expression:
* integral3D (u.dx * v.dx + u.dy * v.dy)
*
* Steps involved:
* 1. Calculate the area of the triangle.
* 2. Compute the gradients of the shape functions.
* 3. Return (u.dx * v.dx + u.dy * v.dy);
*/
/*---------------------------------------------------------------------------*/

FixedMatrix<4, 4> FemModule::
_computeElementMatrixTetra4(Cell cell)
{
Real volume = ArcaneFemFunctions::MeshOperation::computeVolumeTetra4(cell, m_node_coord);

Real4 dxU = ArcaneFemFunctions::FeOperation3D::computeGradientXTetra4(cell, m_node_coord);
Real4 dyU = ArcaneFemFunctions::FeOperation3D::computeGradientYTetra4(cell, m_node_coord);
Real4 dzU = ArcaneFemFunctions::FeOperation3D::computeGradientZTetra4(cell, m_node_coord);

return volume * (dxU ^ dxU) + volume * (dyU ^ dyU) + volume * (dzU ^ dzU);
}

/*---------------------------------------------------------------------------*/
/**
* @brief Calls the right function for LHS assembly
Expand Down
26 changes: 26 additions & 0 deletions modules/laplace/FemModule.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,4 +150,30 @@ ARCCORE_HOST_DEVICE FixedMatrix<3, 3> computeElementMatrixTria3Gpu(CellLocalId c
return area * (dxU ^ dxU) + area * (dyU ^ dyU);
}

/*---------------------------------------------------------------------------*/
/**
* @brief Computes the element matrix for a tetrahedral element (P1 FE).
*
* This function calculates the integral of the expression:
* integral3D (u.dx * v.dx + u.dy * v.dy)
*
* Steps involved:
* 1. Calculate the area of the triangle.
* 2. Compute the gradients of the shape functions.
* 3. Return (u.dx * v.dx + u.dy * v.dy);
*/
/*---------------------------------------------------------------------------*/

FixedMatrix<4, 4> FemModule::
_computeElementMatrixTetra4(Cell cell)
{
Real volume = ArcaneFemFunctions::MeshOperation::computeVolumeTetra4(cell, m_node_coord);

Real4 dxU = ArcaneFemFunctions::FeOperation3D::computeGradientXTetra4(cell, m_node_coord);
Real4 dyU = ArcaneFemFunctions::FeOperation3D::computeGradientYTetra4(cell, m_node_coord);
Real4 dzU = ArcaneFemFunctions::FeOperation3D::computeGradientZTetra4(cell, m_node_coord);

return volume * (dxU ^ dxU) + volume * (dyU ^ dyU) + volume * (dzU ^ dzU);
}

#endif

0 comments on commit 319d46a

Please sign in to comment.