59 oEnrFunc =
sgn(iLevelSet);
70 if ( iLevelSet > 0.0 ) {
85 oEnrFunc = fabs(iLevelSet);
92 oEnrFuncDeriv.
at(1) = iGradLevelSet.
at(1) *
sgn(iLevelSet);
93 oEnrFuncDeriv.
at(2) = iGradLevelSet.
at(2) *
sgn(iLevelSet);
98 oEnrFunc.push_back( sqrt(iR) * sin(0.5 * iTheta) );
99 oEnrFunc.push_back( sqrt(iR) * sin(0.5 * iTheta) * sin(iTheta) );
100 oEnrFunc.push_back( sqrt(iR) * cos(0.5 * iTheta) );
101 oEnrFunc.push_back( sqrt(iR) * cos(0.5 * iTheta) * sin(iTheta) );
110 const double drdx = cos(iTheta);
111 const double drdy = sin(iTheta);
112 const double dtdx = -( 1.0 / iR ) * sin(iTheta);
113 const double dtdy = ( 1.0 / iR ) * cos(iTheta);
130 const double dP1dr = ( 1.0 / ( 2.0 * sqrt(iR) ) ) * sin(0.5 * iTheta);
131 const double dP1dt = 0.5 * sqrt(iR) * cos(0.5 * iTheta);
132 oEnrFuncDeriv.push_back({ dP1dr *drdx + dP1dt *dtdx, dP1dr *drdy + dP1dt *dtdy });
135 const double dP2dr = ( 1.0 / ( 2.0 * sqrt(iR) ) ) * sin(0.5 * iTheta) * sin(iTheta);
136 const double dP2dt = 0.5 * sqrt(iR) * cos(0.5 * iTheta) * sin(iTheta) + sqrt(iR) * sin(0.5 * iTheta) * cos(iTheta);
137 oEnrFuncDeriv.push_back({ dP2dr *drdx + dP2dt *dtdx, dP2dr *drdy + dP2dt *dtdy });
140 const double dP3dr = ( 1.0 / ( 2.0 * sqrt(iR) ) ) * cos(0.5 * iTheta);
141 const double dP3dt = -0.5 * sqrt(iR) * sin(0.5 * iTheta);
142 oEnrFuncDeriv.push_back({ dP3dr *drdx + dP3dt *dtdx, dP3dr *drdy + dP3dt *dtdy });
145 const double dP4dr = ( 1.0 / ( 2.0 * sqrt(iR) ) ) * cos(0.5 * iTheta) * sin(iTheta);
146 const double dP4dt = -0.5 * sqrt(iR) * sin(0.5 * iTheta) * sin(iTheta) + sqrt(iR) * cos(0.5 * iTheta) * cos(iTheta);
147 oEnrFuncDeriv.push_back({ dP4dr *drdx + dP4dt *dtdx, dP4dr *drdy + dP4dt *dtdy });
152 OOFEM_ERROR(
"The radius is needed to compute the jump for branch functions.")
162 oJumps.push_back( 2.0 * sqrt(iRadius) );
163 oJumps.push_back(0.0);
164 oJumps.push_back(0.0);
165 oJumps.push_back(0.0);
170 oEnrFunc.push_back( pow(iR,mExponent) * sin(0.5 * iTheta) );
179 const double drdx = cos(iTheta);
180 const double drdy = sin(iTheta);
181 const double dtdx = -( 1.0 / iR ) * sin(iTheta);
182 const double dtdy = ( 1.0 / iR ) * cos(iTheta);
187 const double dP1dr = mExponent*pow(iR, mExponent-1.0) * sin(0.5 * iTheta);
188 const double dP1dt = 0.5 * pow(iR,mExponent) * cos(0.5 * iTheta);
189 oEnrFuncDeriv.push_back({ dP1dr *drdx + dP1dt *dtdx, dP1dr *drdy + dP1dt *dtdy });
194 OOFEM_ERROR(
"The radius is needed to compute the jump for branch functions.")
204 oJumps.push_back( 2.0 * pow(iRadius,mExponent) );
virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const
virtual void giveJump(std::vector< double > &oJumps) const
Class representing bimaterial interface.
double & at(int i)
Coefficient access function.
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1) ...
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Abstract class representing global shape function Base class declares abstract interface common to al...
virtual void evaluateEnrFuncAt(std::vector< double > &oEnrFunc, const double &iR, const double &iTheta) const
virtual void evaluateEnrFuncDerivAt(std::vector< FloatArray > &oEnrFuncDeriv, const double &iR, const double &iTheta) const
REGISTER_EnrichmentFunction(DiscontinuousFunction)
Class representing Sign EnrichmentFunction.
virtual void giveInputRecord(DynamicInputRecord &input)
Setups the input record string of receiver.
Class representing vector of real numbers.
IRResultType
Type defining the return values of InputRecord reading operations.
virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const
virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const
virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const
Class representing Heaviside EnrichmentFunction.
void zero()
Zeroes all coefficients of receiver.
virtual void evaluateEnrFuncAt(std::vector< double > &oEnrFunc, const double &iR, const double &iTheta) const
virtual void giveJump(std::vector< double > &oJumps) const
virtual void evaluateEnrFuncAt(double &oEnrFunc, const FloatArray &iPos, const double &iLevelSet) const
virtual void evaluateEnrFuncDerivAt(std::vector< FloatArray > &oEnrFuncDeriv, const double &iR, const double &iTheta) const
the oofem namespace is to define a context or scope in which all oofem names are defined.
virtual void evaluateEnrFuncDerivAt(FloatArray &oEnrFuncDeriv, const FloatArray &iPos, const double &iLevelSet, const FloatArray &iGradLevelSet) const
void resize(int s)
Resizes receiver towards requested size.