71const double TransportElement :: stefanBoltzmann = 5.67e-8;
83TransportElement :: initializeFrom(
InputRecord &ir,
int priority)
91TransportElement :: postInitialize()
97TransportElement :: giveDofManDofIDMask(
int inode,
IntArray &answer)
const
118 if ( mtrx == TangentStiffnessMatrix ) {
123 }
else if ( mtrx == ConductivityMatrix ) {
125 }
else if ( mtrx == CapacityMatrix || mtrx == MassMatrix ) {
127 }
else if ( mtrx == LumpedMassMatrix ) {
132 s += answer.
at(i, j);
133 answer.
at(i, j) = 0.0;
150 if ( mtrx == InternalForcesVector ) {
152 }
else if ( mtrx == ExternalForcesVector ) {
155 }
else if ( mtrx == InertiaForcesVector ) {
157 }
else if ( mtrx == LumpedMassMatrix ) {
160 OOFEM_ERROR(
"Unknown Type of characteristic mtrx (%s)",
167TransportElement :: checkConsistency()
176 OOFEM_WARNING(
"cross section without support for transport problems");
181 if ( !this->
giveCrossSection()->testCrossSectionExtension(CS_TransportCapability) ) {
182 OOFEM_WARNING(
"cross-section without support for transport problems", 1);
200 MatResponseMode rmode [ 2 ] = {
201 Capacity_hh, Capacity_ww
205 for (
int i = 1; i <= 2; i++ ) {
223 MatResponseMode rmode [ 2 ] [ 2 ] = { { Conductivity_hh, Conductivity_hw }, { Conductivity_wh, Conductivity_ww } };
225 for (
int i = 1; i <= 2; i++ ) {
226 for (
int j = 1; j <= 2; j++ ) {
268 answer.
resize(nsd*2, nodes*2);
270 for (
int i = 0; i < nodes; ++i) {
271 for (
int j = 0; j < nsd; ++j) {
272 answer(j, i*2) = dnx(i, j);
273 answer(j+nsd, i*2+1) = dnx(i, j);
303TransportElement :: giveEdgeDofMapping(
IntArray &answer,
int iEdge)
307 answer =
dynamic_cast< FEInterpolation2d *
>(interp)->computeLocalEdgeMapping(iEdge);
309 answer =
dynamic_cast< FEInterpolation3d *
>(interp)->computeLocalEdgeMapping(iEdge);
323TransportElement :: giveSurfaceDofMapping(
IntArray &answer,
int iSurf)
327 answer =
dynamic_cast< FEInterpolation3d *
>(interp)->computeLocalSurfaceMapping(iSurf);
332TransportElement :: giveApproxOrder(
int unknownIndx)
338TransportElement :: computeCapacitySubMatrix(
FloatMatrix &answer, MatResponseMode rmode,
int iri,
TimeStep *tStep)
345 this->
computeNAt( n, gp->giveNaturalCoordinates() );
356TransportElement :: computeConductivitySubMatrix(
FloatMatrix &answer,
int iri, MatResponseMode rmode,
TimeStep *tStep)
375TransportElement :: computeInternalSourceRhsSubVectorAt(
FloatArray &answer,
TimeStep *tStep, ValueModeType mode,
int indx)
391 this->
computeNAt( n, gp->giveNaturalCoordinates() );
395 answer.
add(val.
at(indx) * dV, n);
402TransportElement :: computeInternalSourceRhsVectorAt(
FloatArray &answer,
TimeStep *tStep, ValueModeType mode)
409 for (
int i = 1; i <= 2; i++ ) {
438 MatResponseMode rmode [ 2 ] = {
439 IntSource_hh, IntSource_ww
443 for (
int i = 1; i <= 2; i++ ) {
456TransportElement :: computeIntSourceLHSSubMatrix(
FloatMatrix &answer, MatResponseMode rmode,
int iri,
TimeStep *tStep)
468 this->
computeNAt( n, gp->giveNaturalCoordinates() );
480TransportElement :: computeConstitutiveMatrixAt(
FloatMatrix &answer,
499 const FloatArray &lcoords = gp->giveNaturalCoordinates();
523 FloatMatrix bc_tangent;
524 this->computeBCMtrxAt(bc_tangent, tStep, VM_TotalIntrinsic);
525 if ( bc_tangent.isNotEmpty() ) {
526 answer.plusProduct(bc_tangent, unknowns, 1.0);
552 for (
int i = 1; i <= size; i++ ) {
553 for (
int j = 1; j <= size; j++ ) {
554 answer.
at(i) += cap.
at(i, j);
567 if ( type != ExternalForcesVector ) {
587 iRule->setElement(
this);
593 for (
auto &gp: *iRule ) {
594 const FloatArray &lcoords = gp->giveNaturalCoordinates();
597 N.beNMatrixOf(n, unknownsPerNode);
633 for (
auto &gp: *iRule ) {
634 const FloatArray &lcoords = gp->giveNaturalCoordinates();
638 N.beNMatrixOf(n, unknownsPerNode);
646 if ((tf =
domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient))){
647 tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
661 if ( unknownsPerNode != 1 ) {
662 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
668 val.
times( -1.0 * a );
699 if ( unknownsPerNode != 1 ) {
700 OOFEM_ERROR(
"Load property multexpr not implemented for coupled fields");
708 for (
auto &gp : *iRule ) {
709 const FloatArray &lcoords = gp->giveNaturalCoordinates();
715 N.beNMatrixOf(n, unknownsPerNode);
757 for (
auto &gp : *iRule ) {
758 const FloatArray &lcoords = gp->giveNaturalCoordinates();
764 N.beNMatrixOf(n, unknownsPerNode);
769 if ( unknownsPerNode != 1 ) {
770 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
818 for (
auto &gp: *iRule ) {
819 const FloatArray &lcoords = gp->giveNaturalCoordinates();
822 N.beNMatrixOf(n, unknownsPerNode);
829 FieldPtr tf =
domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient);
832 tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
848 if ( unknownsPerNode != 1 ) {
849 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
855 val.
times( -1.0 * a );
867TransportElement :: computeExternalForcesVector(
FloatArray &answer,
TimeStep *tStep, ValueModeType mode)
883 for (
int i = 1; i <= 2; i++ ) {
897 answer.
resize(ndofs, ndofs);
905 for (
int i = 1; i <= 2; i++ ) {
918TransportElement :: computeBCSubVectorAt(
FloatArray &answer,
TimeStep *tStep, ValueModeType mode,
int indx)
927 for (
int i = 1; i <= nLoads; i++ ) {
959 TimeStep *tStep, ValueModeType mode,
int indx)
967 this->
computeNAt( n, gp->giveNaturalCoordinates() );
970 answer.
add(val.
at(indx) * dV, n);
976TransportElement :: computeEdgeBCSubVectorAt(
FloatArray &answer,
Load *load,
int iEdge,
977 TimeStep *tStep, ValueModeType mode,
int indx)
986 int numberOfEdgeIPs = ( int ) ceil( ( approxOrder + 1.0 ) / 2. );
991 double dV, coeff = 1.0;
1000 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
1009 coeff = edgeLoad->
giveProperty(
'a', tStep, { {
"u", value } });
1014 OOFEM_ERROR(
"Not implemented, use TransientTransport solver");
1018 const FloatArray &lcoords = gp->giveNaturalCoordinates();
1024 if ((tf =
domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient))){
1028 tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
1037 reducedAnswer.
add(val.
at(indx) * coeff * dV, n);
1041 answer.
assemble(reducedAnswer, mask);
1050 int iSurf,
TimeStep *tStep, ValueModeType mode,
int indx)
1069 for (
auto &gp: *iRule ) {
1076 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
1085 coeff = surfLoad->
giveProperty(
'a', tStep, { {
"u", value } });
1090 OOFEM_ERROR(
"Not implemented, use TransientTransport solver");
1100 if ( (tf =
domain->giveEngngModel()->giveContext()->giveFieldManager()->giveField(FT_TemperatureAmbient)) ) {
1103 tf->evaluateAt(val, gcoords, VM_TotalIntrinsic, tStep);
1105 surfLoad->
computeValueAt(val, tStep, gp->giveNaturalCoordinates(), mode);
1113 reducedAnswer.
add(val.
at(indx) * coeff * dV, n);
1117 answer.
assemble(reducedAnswer, mask);
1134 for (
int i = 1; i <= nLoads; i++ ) {
1148 int numberOfEdgeIPs = ( int ) ceil( ( approxOrder + 1. ) / 2. );
1155 for (
auto &gp: iRule ) {
1163 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
1171 a = edgeLoad->
giveProperty(
'a', tStep, { {
"u", value } });
1193 int approxOrder = 2;
1195 for (
auto &gp: *iRule ) {
1203 OOFEM_ERROR(
"Not implemented for >=2 coupled fields");
1211 a = surfLoad->
giveProperty(
'a', tStep, { {
"u", value } });
1238 int ndofs,
int rdof,
int cdof)
1242 for (
int i = 1; i <= nnodes; i++ ) {
1243 int ti = ( i - 1 ) * ndofs + rdof;
1244 for (
int j = 1; j <= nnodes; j++ ) {
1245 int tj = ( j - 1 ) * ndofs + cdof;
1246 answer.
at(ti, tj) += src.
at(i, j);
1254 int ndofs,
int rdof)
1258 for (
int i = 1; i <= nnodes; i++ ) {
1259 int ti = ( i - 1 ) * ndofs + rdof;
1260 answer.
at(ti) += src.
at(i);
1327TransportElement :: updateInternalState(
TimeStep *tStep)
1339#ifdef __CEMHYD_MODULE
1354 for (
auto &gp: *iRule ) {
1391 for (
int i = 1; i <= dofId.
giveSize(); i++ ) {
1394 for (
int j = 1; j <= elemvector.
giveSize(); j++ ) {
1395 sum += n.
at(indx, j) * elemvector.
at(j);
1407 OOFEM_ERROR(
"target point not in receiver volume");
1414TransportElement :: giveTransportCrossSection()
1421TransportElement :: giveMaterial()
1446 if ( type == IST_Temperature ) {
1448 if ( dofindx != n->
end() ) {
1450 answer.
at(1) = (*dofindx)->giveUnknown(VM_Total, tStep);
1455 }
else if ( type == IST_MassConcentration_1 ) {
1457 if ( dofindx != n->
end() ) {
1459 answer.
at(1) = (*dofindx)->giveUnknown(VM_Total, tStep);
1465 return Element :: giveInternalStateAtNode(answer, type, mode, node, tStep);
bcType giveType() const override
void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode) override
virtual double giveProperty(int aProperty, TimeStep *tStep, const std ::map< std ::string, FunctionArgument > &valDict) const
virtual double giveTemperOffset(void)
Return temperature offset.
ScalarFunction propertyMultExpr
Expression to multiply all properties.
int giveApproxOrder() override=0
int initMaterial(Element *element) override
std::vector< Dof * >::const_iterator findDofWithDofId(DofIDItem dofID) const
std::vector< Dof * >::iterator end()
Function * giveFunction(int n)
virtual void giveElementDofIDMask(IntArray &answer) const
Node * giveNode(int i) const
IntArray boundaryLoadArray
virtual int computeGlobalCoordinates(FloatArray &answer, const FloatArray &lcoords)
virtual bool isActivated(TimeStep *tStep)
virtual FEInterpolation * giveInterpolation() const
virtual std::unique_ptr< IntegrationRule > giveBoundaryEdgeIntegrationRule(int order, int boundary)
virtual int computeNumberOfDofs()
void initializeFrom(InputRecord &ir, int priority) override
virtual std::unique_ptr< IntegrationRule > giveBoundarySurfaceIntegrationRule(int order, int boundary)
void computeVectorOf(ValueModeType u, TimeStep *tStep, FloatArray &answer)
IntArray * giveBoundaryLoadArray()
Returns array containing load numbers of boundary loads acting on element.
void postInitialize() override
Performs post initialization steps.
virtual IntegrationRule * giveIntegrationRule(int i)
std::vector< std ::unique_ptr< IntegrationRule > > integrationRulesArray
int material
Number of associated material.
virtual int giveNumberOfDofManagers() const
CrossSection * giveCrossSection()
virtual IntegrationRule * giveDefaultIntegrationRulePtr()
Element(int n, Domain *aDomain)
virtual int testElementExtension(ElementExtension ext)
virtual bool computeLocalCoordinates(FloatArray &answer, const FloatArray &gcoords)
virtual double computeVolumeAround(GaussPoint *gp)
void computeBoundaryVectorOf(const IntArray &bNodes, const IntArray &dofIDMask, ValueModeType u, TimeStep *tStep, FloatArray &answer, bool padding=false)
virtual Element_Geometry_Type giveGeometryType() const =0
virtual IntArray boundaryEdgeGiveNodes(int boundary, const Element_Geometry_Type, bool includeHierarchical=false) const =0
virtual IntArray boundaryGiveNodes(int boundary, const Element_Geometry_Type) const =0
virtual double boundaryGiveTransformationJacobian(int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void evalN(FloatArray &answer, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundaryEdgeEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual std::unique_ptr< IntegrationRule > giveIntegrationRule(int order, const Element_Geometry_Type) const
int giveInterpolationOrder() const
virtual void boundaryLocal2Global(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
virtual void boundaryEvalN(FloatArray &answer, int boundary, const FloatArray &lcoords, const FEICellGeometry &cellgeo) const =0
Domain * giveDomain() const
Domain * domain
Link to domain object, useful for communicating with other FEM components.
int number
Component number.
void assemble(const FloatArray &fe, const IntArray &loc)
void plusProduct(const FloatMatrix &b, const FloatArray &s, double dV)
double dotProduct(const FloatArray &x) const
Index giveSize() const
Returns the size of receiver.
void zero()
Zeroes all coefficients of receiver.
void power(const double exponent)
void beProductOf(const FloatMatrix &aMatrix, const FloatArray &anArray)
bool isEmpty() const
Returns true if receiver is empty.
void add(const FloatArray &src)
void subtract(const FloatArray &src)
bool isNotEmpty() const
Returns true if receiver is not empty.
void plusProductSymmUpper(const FloatMatrix &a, const FloatMatrix &b, double dV)
void add(const FloatMatrix &a)
void resize(Index rows, Index cols)
*Sets size of receiver to be an empty matrix It will have zero rows and zero columns size void clear()
int giveNumberOfColumns() const
Returns number of columns of receiver.
void beProductOf(const FloatMatrix &a, const FloatMatrix &b)
void beNMatrixOf(const FloatArray &n, int nsd)
void setSubMatrix(const FloatMatrix &src, int sr, int sc)
void beTranspositionOf(const FloatMatrix &src)
void zero()
Zeroes all coefficient of receiver.
bool isNotEmpty() const
Tests for empty matrix.
void plusDyadSymmUpper(const FloatArray &a, double dV)
int giveNumberOfRows() const
Returns number of rows of receiver.
void assemble(const FloatMatrix &src, const IntArray &loc)
double at(std::size_t i, std::size_t j) const
virtual double evaluateAtTime(double t)
int SetUpPointsOnLine(int nPoints, MaterialMode mode) override
const FloatArray & giveNaturalCoordinates() const
Returns coordinate array of receiver.
virtual bcGeomType giveBCGeoType() const
virtual bool isImposed(TimeStep *tStep)
virtual bcType giveType() const
int findFirstIndexOf(int value) const
virtual void computeValueAt(FloatArray &answer, TimeStep *tStep, const FloatArray &coords, ValueModeType mode)=0
virtual int giveApproxOrder()
int isDofExcluded(int index)
virtual FormulationType giveFormulationType()
double giveTargetTime()
Returns target time.
static ParamKey IPK_TransportElement_vof_function
virtual void computeEgdeNAt(FloatArray &answer, int iEdge, const FloatArray &lcoord)
virtual void computeInertiaForcesVector(FloatArray &answer, TimeStep *tStep)
void computeSurfaceBCSubVectorAt(FloatArray &answer, Load *load, int iSurf, TimeStep *tStep, ValueModeType mode, int indx)
void computeBCSubVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode, int indx)
static const double stefanBoltzmann
Stefan–Boltzmann constant W/m2/K4.
virtual void giveSurfaceDofMapping(IntArray &mask, int iSurf)
void computeBCSubMtrxAt(FloatMatrix &answer, TimeStep *tStep, ValueModeType mode, int indx)
virtual double computeEdgeVolumeAround(GaussPoint *gp, int iEdge)
virtual void computeConductivityMatrix(FloatMatrix &answer, MatResponseMode rMode, TimeStep *tStep)
void computeEdgeBCSubVectorAt(FloatArray &answer, Load *load, int iEdge, TimeStep *tStep, ValueModeType mode, int indx)
virtual void computeSurfaceNAt(FloatArray &answer, int iSurf, const FloatArray &lcoord)
virtual double computeVof(TimeStep *tStep)
Material * giveMaterial() override
virtual void computeBmatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
virtual double giveThicknessAt(const FloatArray &gcoords)
int vofFunction
Fuction determining the relative volume of reference material in element.
virtual void computeNmatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
virtual int giveApproxOrder(int unknownIndx)
virtual void computeIntSourceLHSSubMatrix(FloatMatrix &answer, MatResponseMode rmode, int iri, TimeStep *tStep)
void giveCharacteristicMatrix(FloatMatrix &answer, CharType type, TimeStep *tStep) override
virtual void computeConductivitySubMatrix(FloatMatrix &answer, int iri, MatResponseMode rmode, TimeStep *tStep)
void computeBodyBCSubVectorAt(FloatArray &answer, Load *load, TimeStep *tStep, ValueModeType mode, int indx)
virtual double computeSurfaceVolumeAround(GaussPoint *gp, int iSurf)
virtual void computeNAt(FloatArray &answer, const FloatArray &lcoord)
virtual void giveEdgeDofMapping(IntArray &mask, int iEdge)
virtual void computeCapacityMatrix(FloatMatrix &answer, TimeStep *tStep)
virtual void computeCapacitySubMatrix(FloatMatrix &answer, MatResponseMode rmode, int iri, TimeStep *tStep)
virtual void computeInternalSourceRhsSubVectorAt(FloatArray &answer, TimeStep *, ValueModeType mode, int indx)
virtual void computeGradientMatrixAt(FloatMatrix &answer, const FloatArray &lcoords)
virtual void computeConstitutiveMatrixAt(FloatMatrix &answer, MatResponseMode rMode, GaussPoint *gp, TimeStep *tStep)
virtual void computeLumpedCapacityVector(FloatArray &answer, TimeStep *tStep)
virtual void computeBCMtrxAt(FloatMatrix &answer, TimeStep *tStep, ValueModeType mode)
void assembleLocalContribution(FloatMatrix &answer, FloatMatrix &src, int ndofs, int rdof, int cdof)
virtual void computeBCVectorAt(FloatArray &answer, TimeStep *tStep, ValueModeType mode)
virtual void computeInternalForcesVector(FloatArray &answer, TimeStep *tStep)
virtual void updateInternalState(const FloatArray &state, GaussPoint *gp, TimeStep *tStep)
virtual void computeInternalSourceVector(FloatArray &val, GaussPoint *gp, TimeStep *tStep, ValueModeType mode) const
virtual double giveCharacteristicValue(MatResponseMode mode, GaussPoint *gp, TimeStep *tStep) const override=0
virtual void giveFluxVector(FloatArray &answer, GaussPoint *gp, const FloatArray &grad, const FloatArray &field, TimeStep *tStep) const
virtual bool hasInternalSource() const
#define OOFEM_WARNING(...)
bcGeomType
Type representing the geometric character of loading.
@ SurfaceLoadBGT
Distributed surface load.
@ EdgeLoadBGT
Distributed edge load.
const char * __CharTypeToString(CharType _value)
InternalStateMode
Determines the mode of internal variable.
double sum(const FloatArray &x)
@ RadiationBC
Stefan-Boltzmann law.
@ TransmissionBC
Neumann type (prescribed flux).
@ ConvectionBC
Newton type - transfer coefficient.
@ Element_SurfaceLoadSupport
Element extension for surface loads.
std::shared_ptr< Field > FieldPtr
#define PM_UPDATE_PARAMETER(_val, _pm, _ir, _componentnum, _paramkey, _prio)