47 const std :: list< int > &bcDofMans,
83 const std :: list< int > &bcDofMans,
95 for ( i = 0; i < nnode; i++ ) {
101 for (
int jnode: bcDofMans ) {
110 for (
int jnode: bcDofMans ) {
115 if ( neighbor == i ) {
135 int ai, bi, ci, h, nroot, _ind = 0;
136 double at, bt, ht, a, b, u, cos_fi, sin_fi, _a, _b, _c, r1, r2, r3, t = 0.0, _h;
148 for (
int j = 1; j <= 3; j++ ) {
160 at = dmanValues.
at(ai);
161 bt = dmanValues.
at(bi);
162 if ( fabs(at) > fabs(bt) ) {
186 sin_fi = sqrt(1.0 - cos_fi * cos_fi);
189 _a = ( a * a + b * b - 2.0 * a * b * cos_fi );
190 _b = 2.0 * b * u * ( a * cos_fi - b );
191 _c = b * b * ( u * u - F * F * a * a * sin_fi * sin_fi );
192 cubic3r(0.0, _a, _b, _c, & r1, & r2, & r3, & nroot);
196 reg_upd_flag =
false;
197 }
else if ( nroot == 1 ) {
199 }
else if ( r1 >= 0.0 ) {
201 }
else if ( r2 >= 0.0 ) {
204 reg_upd_flag =
false;
207 if ( reg_upd_flag ) {
208 _h = b * ( t - u ) / t;
209 if ( ( t > u ) && ( _h > a * cos_fi ) && ( _h < a / cos_fi ) ) {
211 dmanValues.
at(ci) =
sgn(F) * t + at;
212 }
else if ( F > 0. ) {
213 dmanValues.
at(ci) =
min(dmanValues.
at(ci),
sgn(F) * t + at);
215 dmanValues.
at(ci) =
max(dmanValues.
at(ci),
sgn(F) * t + at);
218 reg_upd_flag =
false;
222 if ( !reg_upd_flag ) {
224 _h =
min(b * F + at, a * F + bt);
226 _h =
max(b * F + at, a * F + bt);
230 dmanValues.
at(ci) = _h;
231 }
else if ( F > 0. ) {
232 dmanValues.
at(ci) =
min(dmanValues.
at(ci), _h);
234 dmanValues.
at(ci) =
max(dmanValues.
at(ci), _h);
void updateTrialValue(FloatArray &dmanValues, int id, double F)
Updates the distance of trial node with given id).
int giveDofManagerNumber(int i) const
Translates local to global indices for dof managers.
int giveNumberOfDofManagers() const
Returns number of dof managers in domain.
double & at(int i)
Coefficient access function.
int max(int i, int j)
Returns bigger value form two given decimals.
double sgn(double i)
Returns the signum of given value (if value is < 0 returns -1, otherwise returns 1) ...
ConnectivityTable * giveConnectivityTable()
Returns receiver's associated connectivity table.
Abstract base class for all finite elements.
Boundary nodes, from which the front will not propagate.
std::vector< FMM_DofmanRecord > dmanRecords
Array of DofManager records.
void beDifferenceOf(const FloatArray &a, const FloatArray &b)
Sets receiver to be a - b.
const FloatArray * dmanValuesPtr
Pointer to working set of dmanValues.
void solve(FloatArray &dmanValues, const std::list< int > &bcDofMans, double F)
Solution of problem.
double distance(const FloatArray &x) const
Computes the distance between position represented by receiver and position given as parameter...
const IntArray & giveDofManArray() const
Element * giveElement(int n)
Service for accessing particular domain fe element.
void cubic3r(double a, double b, double c, double d, double *r1, double *r2, double *r3, int *num)
Solves cubic equation for real roots, assuming that if cubic polynomial given then the only possibili...
double dotProduct(const FloatArray &x) const
Computes the dot product (or inner product) of receiver and argument.
Trial nodes, candidates for known (accepted).
std::priority_queue< int, std::vector< int >, FMM_DofmanRecordDelegate_greater > dmanTrialQueue
Priority queue for trial T values.
Class representing connectivity table.
void initialize(FloatArray &dmanValues, const std::list< int > &bcDofMans, double F)
Initialize receiver.
Class representing vector of real numbers.
const IntArray * giveDofManConnectivityArray(int dofman)
int getSmallestTrialDofMan()
Get the trial point with smallest T; zero if empty.
virtual FloatArray * giveCoordinates()
int min(int i, int j)
Returns smaller value from two given decimals.
virtual Element_Geometry_Type giveGeometryType() const
Returns the element geometry type.
Node * giveNode(int n)
Service for accessing particular domain node.
the oofem namespace is to define a context or scope in which all oofem names are defined.
double normalize()
Normalizes receiver.