22 #include "SheafSystem/point_locator.h" 24 #include "SheafSystem/assert_contract.h" 25 #include "SheafSystem/chart_point_3d.h" 26 #include "SheafSystem/error_message.h" 27 #include "SheafSystem/preorder_iterator.h" 28 #include "SheafSystem/sec_at1_space.h" 29 #include "SheafSystem/sec_ed.h" 30 #include "SheafSystem/std_iostream.h" 51 invariance(dc() == coordinates().schema().df());
89 sec_ed& result = _coordinates;
185 require(xpt_ub >= dc());
189 for(
int i=0; i<dc(); i++)
191 result = result && ((_lb[i] <= xpt[i]) && (xpt[i] <= _ub[i]));
196 ensure_for_all(i, 0, dc(),
197 result ? ((lb()[i] <= xpt[i]) && (xpt[i] <= ub()[i])) :
true);
211 require(coordinates().state_is_read_accessible());
261 ensure_for_all(i, 0, xresult.
ct(), xresult[i].is_valid());
279 define_old_variable(
int old_xresult_ct = xresult.
ct());
285 ensure(xresult.
ct() >= old_xresult_ct);
286 ensure_for_all(i, old_xresult_ct, xresult.
ct(),
287 coordinates().host()->contains_member(xresult[i].first,
false));
288 ensure_for_all(i, old_xresult_ct, xresult.
ct(), xresult[i].second.is_valid());
300 : _coordinates(*(new
sec_ed()))
321 : _coordinates(xcoords)
365 static_cast<sec_vd_value_type>(10.0)*numeric_limits<sec_vd_value_type>::epsilon();
367 if(x == static_cast<sec_vd_value_type>(0.0))
371 else if(x < static_cast<sec_vd_value_type>(0.0))
401 static_cast<sec_vd_value_type>(10.0)*numeric_limits<sec_vd_value_type>::epsilon();
403 if(x == static_cast<sec_vd_value_type>(0.0))
407 else if(x < static_cast<sec_vd_value_type>(0.0))
429 #ifdef DIAGNOSTIC_OUTPUT 430 post_information_message(
"entering update_domain");
458 for(
int i=0; i<
_dc; ++i)
479 for(
int i=0; i<
_dc; ++i)
486 #ifdef DIAGNOSTIC_OUTPUT 487 cout <<
"_lb: " <<
_lb << endl;
488 cout <<
"_ub: " <<
_ub << endl;
489 post_information_message(
"leaving update_domain");
504 : _coordinates(xother._coordinates)
522 geometry::point_locator::
virtual void update()=0
Updates the search structure to the current values of coordinates().
virtual void point_at_value(const sec_vd_value_type *xvalue, size_type xvalue_ub, chart_point &xresult)=0
Finds a chart point at which coordinates() has value xvalue.
void truncate()
Makes this the next member of the subset which is not less than old this, i.e. the depth-first descen...
int _dc
The spatial dimension of the domain; the dimension of the global coordinates.
index_type ub() const
The upper bound on the storage array. The number of items current allocated in the storage array...
size_type ct() const
The number of items currently in use.
sec_ed & coordinates() const
The coordinate section this inverts.
virtual ~point_locator()
Destructor.
bool state_is_read_accessible() const
True if this is attached and if the state is accessible for read or access control is disabled...
virtual void all_points_at_value(const sec_vd_value_type *xvalue, size_type xvalue_ub, block< chart_point_3d > &xresult)=0
Finds all chart points at which coordinates() has value xvalue and appends them to xresult...
void reserve(index_type xub)
Makes ub() at least xub; if new storage is allocated, it is uninitialized.
point_locator()
Default constructor.
void update_domain()
Initializes the domain bounds and dimension.
host_type * host() const
The poset this is a member of.
static sec_vd_value_type slightly_less_than(sec_vd_value_type x)
A value slightly less then x.
const block< sec_vd_value_type > & lb() const
The lower bound of the domain defined by coordinates().
static sec_vd_value_type slightly_greater_than(sec_vd_value_type x)
A value slightly greater then x.
A section of a fiber bundle with a d-dimensional Euclidean vector space fiber.
const bool NOT_STRICT
Iteration strictness control.
const bool DOWN
Iteration directions.
block< sec_vd_value_type > _lb
The lower bound of the domain.
void assign(const_reference_type xitem)
Sets the values of all items to xitem.
pointer_type base() const
The underlying storage array.
void set_ct(size_type xct)
Sets ct() == xct.
int _db
The intrinsic dimension of the domain; the dimension of the local coordinates.
virtual bool invariant() const
Class invariant.
unsigned long size_type
An unsigned integral type used to represent sizes and capacities.
SHEAF_DLL_SPEC void max(const vd &x0, vd_value_type &xresult, bool xauto_access)
Maximum component of x0, pre-allocated version.
A section of a fiber bundle with a d-dimensional vector space fiber.
bool is_done() const
True if iteration finished.
void detach_from_state()
Detaches field from state it is currently attached to.
int db() const
The intrinsic dimension of the domain; the dimension of the local coordinates.
virtual section_space_schema_member & schema()
The restricted schema for this (mutable version).
int dc() const
The spatial dimension of the domain; the dimension of the global coordinates.
block< sec_vd_value_type > _ub
The upper bound of the domain.
SHEAF_DLL_SPEC void extrema(const sec_vd &x0, vd_lite &xmin, vd_lite &xmax, bool xauto_access)
Extrema (pre-allocated version).
const block< sec_vd_value_type > & ub() const
The upper bound of the domain defined by coordinates().
Namespace containing the algrebra functions for a a section of a fiber bundle with a d-dimensional ve...
int db() const
The dimension of the base space component.
int df() const
The dimension of the fiber space component.
void attach_to_state(const namespace_poset *xns, const poset_path &xpath, bool xauto_access=true)
Attach to the state specified by path xpath in the namespace xns.
virtual void branch_points_at_value(const sec_vd_value_type *xvalue, size_type xvalue_ub, block< branch_point_pair > &xresult)=0
Finds one chart point in each branch at which coordinates() has value xvalue and appends them to xres...
An auto_block with a no-initialization initialization policy.
Namespace for geometry component of sheaf system.
vd_value_type sec_vd_value_type
The type of component in the value of a section at a point.
bool domain_contains(sec_vd_value_type *xpt, size_type xpt_ub) const
True if the domain contains xpt.
An abstract point location query in domains with global coordinate dimension dc and local coordinate ...
const scoped_index & index() const
The index of the current member of the iteration.