dudley/src/Assemble.h
Go to the documentation of this file.
/*****************************************************************************
*
* Copyright (c) 2003-2020 by The University of Queensland
* http://www.uq.edu.au
*
* Primary Business: Queensland, Australia
* Licensed under the Apache License, version 2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Development until 2012 by Earth Systems Science Computational Center (ESSCC)
* Development 2012-2013 by School of Earth Sciences
* Development from 2014-2017 by Centre for Geoscience Computing (GeoComp)
* Development from 2019 by School of Earth and Environmental Sciences
**
*****************************************************************************/
/****************************************************************************
Assemblage routines: header file
*****************************************************************************/
#ifndef __DUDLEY_ASSEMBLE_H__
#define __DUDLEY_ASSEMBLE_H__
#include "Dudley.h"
#include "ElementFile.h"
#include "NodeFile.h"
#include <escript/AbstractSystemMatrix.h>
namespace dudley {
struct AssembleParameters
{
AssembleParameters(const NodeFile* nodes, const ElementFile* ef,
escript::ASM_ptr sm, escript::Data& rhs,
bool reducedOrder);
const ElementFile* elements;
escript::AbstractSystemMatrix* S;
escript::Data& F;
int numQuad;
int numDim;
int NN;
int numEqu;
const index_t* DOF;
dim_t DOF_UpperBound;
const ElementFile_Jacobians* jac;
int numShapes;
const double* shapeFns;
};
void Assemble_PDE(const NodeFile* nodes, const ElementFile* elements,
escript::ASM_ptr S, escript::Data& F,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y);
template<typename Scalar = double>
void Assemble_PDE_Points(const AssembleParameters& p,
const escript::Data& d_dirac,
const escript::Data& y_dirac);
template<typename Scalar = double>
void Assemble_PDE_Single_2D(const AssembleParameters& p,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y);
template<typename Scalar = double>
void Assemble_PDE_Single_3D(const AssembleParameters& p,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y);
template<typename Scalar = double>
void Assemble_PDE_System_2D(const AssembleParameters& p,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y);
template<typename Scalar = double>
void Assemble_PDE_System_3D(const AssembleParameters& p,
const escript::Data& A, const escript::Data& B,
const escript::Data& C, const escript::Data& D,
const escript::Data& X, const escript::Data& Y);
template<typename Scalar>
void Assemble_addToSystemMatrix(escript::AbstractSystemMatrix* S,
const std::vector<index_t>& Nodes, int numEq,
const std::vector<Scalar>& array);
void Assemble_LumpedSystem(const NodeFile* nodes, const ElementFile* elements,
escript::Data& lumpedMat, const escript::Data& D,
bool useHRZ);
template<typename Scalar>
void Assemble_AverageElementData(const ElementFile* elements,
escript::Data& out, const escript::Data& in);
template<typename Scalar>
void Assemble_CopyElementData(const ElementFile* elements, escript::Data& out,
const escript::Data& in);
template<typename Scalar>
void Assemble_CopyNodalData(const NodeFile* nodes, escript::Data& out,
const escript::Data& in);
void Assemble_NodeCoordinates(const NodeFile* nodes, escript::Data& x);
void Assemble_getNormal(const NodeFile* nodes, const ElementFile* elements,
escript::Data& normals);
void Assemble_getSize(const NodeFile* nodes, const ElementFile* elements,
escript::Data& size);
template<typename Scalar>
void Assemble_gradient(const NodeFile* nodes, const ElementFile* elements,
escript::Data& gradient, const escript::Data& data);
template<typename Scalar>
void Assemble_integrate(const NodeFile* nodes, const ElementFile* elements,
const escript::Data& data, std::vector<Scalar>& integrals);
template<typename Scalar>
void Assemble_interpolate(const NodeFile* nodes, const ElementFile* elements,
const escript::Data& data, escript::Data& output);
void Assemble_jacobians_2D(const double* coordinates, int numQuad,
dim_t numElements, int numNodes,
const index_t* nodes, double* dTdX, double* absD,
double* quadWeight, const index_t* elementId);
void Assemble_jacobians_2D_M1D_E1D(const double* coordinates, int numQuad,
dim_t numElements, int numNodes,
const index_t* nodes, double* dTdX, double* absD,
double* quadWeight, const index_t* elementId);
void Assemble_jacobians_3D(const double* coordinates, int numQuad,
dim_t numElements, int numNodes,
const index_t* nodes, double* dTdX, double* abs_D,
double* quadWeight, const index_t* elementId);
void Assemble_jacobians_3D_M2D_E2D(const double* coordinates, int numQuad,
dim_t numElements, int numNodes,
const index_t* nodes, double* dTdX, double* absD,
double* quadWeight, const index_t* elementId);
} // namespace dudley
#endif // __DUDLEY_ASSEMBLE_H__
Dudley.h
S
#define S(_J_, _I_)
Definition: ShapeFunctions.cpp:122
dudley::ElementFile
Definition: dudley/src/ElementFile.h:53
dudley::NodeFile
Definition: dudley/src/NodeFile.h:40
escript::AbstractSystemMatrix
Base class for escript system matrices.
Definition: AbstractSystemMatrix.h:44
escript::Data
Data represents a collection of datapoints.
Definition: Data.h:64
ElementFile.h
NodeFile.h
dudley
A suite of factory methods for creating 2D and 3D dudley domains.
Definition: dudley/src/Assemble.h:32
dudley::Assemble_AverageElementData
void Assemble_AverageElementData(const ElementFile *elements, escript::Data &out, const escript::Data &in)
averages data
Definition: dudley/src/Assemble_AverageElementData.cpp:29
dudley::Assemble_jacobians_2D
void Assemble_jacobians_2D(const double *coordinates, int numQuad, dim_t numElements, int numNodes, const index_t *nodes, double *dTdX, double *absD, double *quadWeight, const index_t *elementId)
Definition: dudley/src/Assemble_jacobians.cpp:56
dudley::Assemble_CopyNodalData
void Assemble_CopyNodalData(const NodeFile *nodes, escript::Data &out, const escript::Data &in)
copies data between different types of nodal representations
Definition: dudley/src/Assemble_CopyNodalData.cpp:27
dudley::Assemble_jacobians_3D_M2D_E2D
void Assemble_jacobians_3D_M2D_E2D(const double *coordinates, int numQuad, dim_t numElements, int numNodes, const index_t *nodes, double *dTdX, double *absD, double *quadWeight, const index_t *elementId)
Definition: dudley/src/Assemble_jacobians.cpp:255
dudley::Assemble_CopyElementData
void Assemble_CopyElementData(const ElementFile *elements, escript::Data &out, const escript::Data &in)
copies data between different types of elements
Definition: dudley/src/Assemble_CopyElementData.cpp:27
dudley::Assemble_PDE_Points
void Assemble_PDE_Points(const AssembleParameters &p, const escript::Data &d_dirac, const escript::Data &y_dirac)
Definition: dudley/src/Assemble_PDE_Points.cpp:46
dudley::Assemble_LumpedSystem
void Assemble_LumpedSystem(const NodeFile *nodes, const ElementFile *elements, escript::Data &lumpedMat, const escript::Data &D, bool useHRZ)
Definition: dudley/src/Assemble_LumpedSystem.cpp:26
dudley::Assemble_PDE_Single_3D
void Assemble_PDE_Single_3D(const AssembleParameters &p, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y)
Definition: dudley/src/Assemble_PDE_Single_3D.cpp:46
dudley::Assemble_getNormal
void Assemble_getNormal(const NodeFile *nodes, const ElementFile *elements, escript::Data &normals)
calculates the normal vector at quadrature points on face elements
Definition: dudley/src/Assemble_getNormal.cpp:26
dudley::Assemble_PDE
void Assemble_PDE(const NodeFile *nodes, const ElementFile *elements, escript::ASM_ptr S, escript::Data &F, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y)
Definition: dudley/src/Assemble_PDE.cpp:84
dudley::Assemble_integrate
void Assemble_integrate(const NodeFile *nodes, const ElementFile *elements, const escript::Data &data, std::vector< Scalar > &integrals)
integrates data on quadrature points
Definition: dudley/src/Assemble_integrate.cpp:29
dudley::Assemble_gradient
void Assemble_gradient(const NodeFile *nodes, const ElementFile *elements, escript::Data &gradient, const escript::Data &data)
Definition: dudley/src/Assemble_gradient.cpp:29
dudley::Assemble_NodeCoordinates
void Assemble_NodeCoordinates(const NodeFile *nodes, escript::Data &x)
copies node coordinates into expanded Data object x
Definition: dudley/src/Assemble_NodeCoordinates.cpp:27
dudley::Assemble_PDE_Single_2D
void Assemble_PDE_Single_2D(const AssembleParameters &p, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y)
Definition: dudley/src/Assemble_PDE_Single_2D.cpp:46
dudley::Assemble_interpolate
void Assemble_interpolate(const NodeFile *nodes, const ElementFile *elements, const escript::Data &data, escript::Data &output)
interpolates nodal data in a data array onto elements (=integration points)
Definition: dudley/src/Assemble_interpolate.cpp:27
dudley::Nodes
@ Nodes
Definition: Dudley.h:53
dudley::Assemble_jacobians_3D
void Assemble_jacobians_3D(const double *coordinates, int numQuad, dim_t numElements, int numNodes, const index_t *nodes, double *dTdX, double *abs_D, double *quadWeight, const index_t *elementId)
Definition: dudley/src/Assemble_jacobians.cpp:180
dudley::Assemble_PDE_System_2D
void Assemble_PDE_System_2D(const AssembleParameters &p, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y)
Definition: dudley/src/Assemble_PDE_System_2D.cpp:49
dudley::Assemble_jacobians_2D_M1D_E1D
void Assemble_jacobians_2D_M1D_E1D(const double *coordinates, int numQuad, dim_t numElements, int numNodes, const index_t *nodes, double *dTdX, double *absD, double *quadWeight, const index_t *elementId)
Definition: dudley/src/Assemble_jacobians.cpp:134
dudley::Assemble_addToSystemMatrix
void Assemble_addToSystemMatrix(escript::AbstractSystemMatrix *S, const std::vector< index_t > &Nodes, int numEq, const std::vector< Scalar > &array)
dudley::Assemble_PDE_System_3D
void Assemble_PDE_System_3D(const AssembleParameters &p, const escript::Data &A, const escript::Data &B, const escript::Data &C, const escript::Data &D, const escript::Data &X, const escript::Data &Y)
Definition: dudley/src/Assemble_PDE_System_3D.cpp:49
dudley::Assemble_getSize
void Assemble_getSize(const NodeFile *nodes, const ElementFile *elements, escript::Data &size)
Definition: dudley/src/Assemble_getSize.cpp:25
escript::DataTypes::dim_t
index_t dim_t
Definition: DataTypes.h:66
escript::DataTypes::index_t
int index_t
type for array/matrix indices used both globally and on each rank
Definition: DataTypes.h:61
escript::ASM_ptr
boost::shared_ptr< AbstractSystemMatrix > ASM_ptr
Definition: AbstractSystemMatrix.h:33
dudley::AssembleParameters
Definition: dudley/src/Assemble.h:35
dudley::AssembleParameters::DOF
const index_t * DOF
row and column degrees of freedom
Definition: dudley/src/Assemble.h:55
dudley::AssembleParameters::jac
const ElementFile_Jacobians * jac
reference to jacobians
Definition: dudley/src/Assemble.h:59
dudley::AssembleParameters::S
escript::AbstractSystemMatrix * S
system matrix to be updated
Definition: dudley/src/Assemble.h:43
dudley::AssembleParameters::F
escript::Data & F
right-hand side to be updated
Definition: dudley/src/Assemble.h:45
dudley::AssembleParameters::shapeFns
const double * shapeFns
Definition: dudley/src/Assemble.h:61
dudley::AssembleParameters::numEqu
int numEqu
number of equations (= matrix row/column block size)
Definition: dudley/src/Assemble.h:53
dudley::AssembleParameters::DOF_UpperBound
dim_t DOF_UpperBound
number of local degrees of freedom
Definition: dudley/src/Assemble.h:57
dudley::AssembleParameters::AssembleParameters
AssembleParameters(const NodeFile *nodes, const ElementFile *ef, escript::ASM_ptr sm, escript::Data &rhs, bool reducedOrder)
Definition: dudley/src/Assemble_getAssembleParameters.cpp:35
dudley::AssembleParameters::NN
int NN
leading dimension of element node table
Definition: dudley/src/Assemble.h:51
dudley::AssembleParameters::elements
const ElementFile * elements
element file these parameters apply to
Definition: dudley/src/Assemble.h:41
dudley::AssembleParameters::numQuad
int numQuad
number of quadrature nodes
Definition: dudley/src/Assemble.h:47
dudley::AssembleParameters::numDim
int numDim
number of spatial dimensions
Definition: dudley/src/Assemble.h:49
dudley::AssembleParameters::numShapes
int numShapes
Definition: dudley/src/Assemble.h:60
dudley::ElementFile_Jacobians
Definition: dudley/src/ElementFile.h:29