% File: ~/domain/domain/Domain.tex 
% What: "@(#) Domain.tex, revA"

\noindent {\bf Files}   \\
\indent \#include $<$/domain/domain/Domain.h$>$  \\

\noindent {\bf Class Declaration}  \\
\indent class Domain  \\

\noindent {\bf Class Hierarchy} \\
\indent  {\bf Domain} \\

\noindent {\bf Description}  \\
\indent Domain is container class for storing and providing access to
the components of a domain, i.e. nodes, elements, boundary conditions,
and load patterns. 
A Domain is a container class which contains the  all elements,
nodes, load cases, single point constraints and multiple point
constraints that the model builder uses to create the model of the
structure. It provides operations for the following: 
\begin{itemize}
\item Population: Methods so that the DomainComponents can be addled
to the Domain. 
\item Depopulation: Methods so that the DomainComponents can be removed
from the Domain.
\item Access: Methods so that other classes, i.e. analysis and design,
can access the DomainComponents.
\item Query: Methods for determining the state of the domain.
\item Update: Methods for updating the state of the Domain
\item Analysis: Methods added for the Analysis class.
\item Output: Methods added for outputting information.
\end{itemize}
The Domain class stores each type of object, i.e. Nodes, Elements,
SP\_Constraints, MP\_Constraints, NodalLoads and ElementalLoads, in a
container object. Currently these container objects are a subtype of
TaggedObjectStorage (templates are not used as yet due to present
difficulties in porting code which uses templates). \\

\noindent {\bf Class Interface}  \\
\indent // Constructors  \\
\indent {\em Domain();}  \\
\indent {\em Domain(int numNodes, int numElements, int numNodeLoads,
int numEleLoads, int numSPs, int numMPs);}  \\
\indent {\em Domain(TaggedObjectStorage \&theNodesStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theElementsStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theMPsStorage,\\
\indent\indent\indent           TaggedObjectStorage \&theSPsStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theLoadPatternsStorage);}\\ 
\indent {\em Domain(TaggedObjectStorage \&theStorageType);}\\ \\
\indent // Destructor  \\
\indent {\em virtual~ $\tilde{}$Domain();}  \\ \\
\indent // Public Methods to Populate the Domain  \\
\indent {\em virtual bool addElement(Element *theElementPtr);}  \\ 
\indent {\em virtual bool addNode(Node *theNodePtr);} \\  
\indent {\em virtual bool addSP\_Constraint(SP\_Constraint
*theSPptr);} \\
\indent {\em virtual bool addMP(MP\_Constraint *theMPptr);}  \\  
\indent {\em virtual bool addLoadPattern(LoadPattern *thePattern);}\\ \\
\indent // Public Methods to Populate the LoadPatterns  \\
\indent {\em virtual bool addSP(SP\_Constraint *theSPptr, int pattern);}  \\   
\indent {\em virtual bool addNodalLoad(NodalLoad *theLd, int pattern);}  \\   
\indent {\em virtual bool addElementalLoad(ElementalLoad *theLd, int pattern);}\\\\
\indent // Public Methods to Depopulate the Domain  \\
\indent {\em virtual void clearAll(void);}\\
\indent {\em virtual Element *removeElement(int tag);}\\
\indent {\em virtual Node *removeNode(int tag);}\\    
\indent {\em virtual SP\_Constraint *removeSP\_Constraint(int tag);}\\
\indent {\em virtual MP\_Constraint *removeMP\_Constraint(int tag);} \\
\indent {\em virtual LoadPattern *removeLoadPattern(int patternTag);}\\ \\
\indent // Public Methods to Access the Components of the Domain  \\
\indent {\em virtual ElementIter \&getElements(void);} \\
\indent {\em virtual NodeIter \&getNodes(void);} \\
\indent {\em virtual SP\_ConstraintIter \&getSPs(void);} \\
\indent {\em virtual MP\_ConstraintIter \&getMPs(void);} \\
\indent {\em virtual  LoadPatternIter \&getLoadPatterns(void);} \\ 
\indent {\em virtual  Element *getElement(int tag);}\\
\indent {\em virtual  Node *getNode(int tag);}\\
\indent {\em virtual  SP\_Constraint *getSP\_ConstraintPtr(int tag);}\\
\indent {\em virtual  MP\_Constraint *getMP\_ConstraintPtr(int tag);}\\ 
\indent {\em virtual  LoadPattern *getLoadPattern(int tag);} \\ \\
\indent // Public Methods to Query the State of the Domain \\
\indent {\em virtual double getCurrentTime(void) const;} \\
\indent {\em virtual double getCurrentLoadFactor(void) const;} \\
\indent {\em virtual int getNumElements(void) const;}\\ 
\indent {\em virtual int getNumNodes(void) const;}\\
\indent {\em virtual int getNumSPs(void) const;}\\
\indent {\em virtual int getNumMPs(void) const;}\\
\indent {\em virtual int getNumLoadPatterns(void) const;}\\
\indent {\em virtual const Vector \&getPhysicalBounds(void);} \\
\indent {\em virtual Graph \&getElementGraph(void);} \\
\indent {\em virtual Graph \&getNodeGraph(void);} \\ \\
\indent // Public Methods to Update the Domain  \\
\indent {\em virtual void setCommitTag(int newTag);} \\
\indent {\em virtual void setCurrentTime(double newTime);} \\
\indent {\em virtual void setCommittedTime(double newTime);} \\
\indent {\em virtual void applyLoad(double pseudoTime);} \\
\indent {\em virtual void setLoadConstant(void);} \\ 
\indent {\em virtual void commit(void);} \\ 
\indent {\em virtual void revertToLastCommit(void);} \\ 
\indent {\em virtual void update(void);} \\ 
\indent {\em virtual int hasDomainChanged(void);} \\ 
\indent {\em virtual void setDomainChangeStamp(int newStamp);}\\\\
\indent // Public Methods for Output \\
\indent {\em virtual  int  addRecorder(Recorder \&theRecorder);}\\
\indent {\em virtual  int  playback(int cTag);}\\
\indent {\em virtual  void Print(OPS_Stream \&s, int flag =0);}\\
\indent {\em friend OPS_Stream \&operator<<(OPS_Stream \&s, Domain \&M); }\\  
\indent // Protected Member Functions  \\
\indent {\em virtual void domainChange(void) }\\
\indent {\em virtual int buildEleGraph(Graph \&theEleGraph)} \\
\indent {\em virtual int buildNodeGraph(Graph \&theNodeGraph)} \\

\noindent {\bf Constructors}  \\
\indent {\em Domain();}  \\
Constructs an empty domain. The storage for the DomainComponents uses
ArrayOfTaggedObjects objects for each type of object to be stored. The
initial sizes specified for these objects are 4096 for the Elements
and Nodes, 256 SP\_Constraints and MP\_Constraints, and 32 for the
container for the LoadPatterns. A check is made to ensure that memory
is allocated for these objects, if not the {\em fatal()} method of the
global ErrorHandler is invoked.\\   

\indent {\em Domain(int numNodes, int numElements, int numSPs, int
numMPs, int numLoadPatterns);}  \\ 
Constructs an empty Domain. The storage for the DomainComponents uses
ArrayOfTaggedObjects objects for each type of object to be stored. The
initial sizes specified for these objects are as given in the
arguments for this constructor, i.e. {\em numElements} for the
Elements and {\em numNodes} for the Nodes. A size of 32 is used for
the LoadPatterns. A check is made to ensure that memory
is allocated for these objects, if not the {\em fatal()} method of the
global ErrorHandler is invoked.\\   


\indent {\em Domain(TaggedObjectStorage \&theNodesStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theElementsStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theMPsStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theSPsStorage, \\
\indent\indent\indent           TaggedObjectStorage \&theLoadPatternsStorage); } \\
Constructs a Domain where the Nodes, Elements, MP\_Constraints,
SP\_Constraint and LoadPattern objects will be
stored in the storage objects provided. A check is made to ensure
these container objects are empty is made; if not empty the {\em warning()}
method of the global ErrorHandler is invoked and the objects are
cleared. \\

\indent {\em Domain(TaggedObjectStorage \&theStorageType); } \\
Constructs a Domain where the Nodes, Elements, MP\_Constraints,
SP\_Constraint and LoadPattern objects will be stored in the storage
objects obtained by invoking {\em getEmptyCopy()} on the {\em
theStorageType} object. A check is made to ensure that memory is
allocated for these objects, if not the {\em fatal()} method of the
global ErrorHandler is invoked.\\    

\noindent {\bf Destructor}  \\
\indent {\em virtual~ $\tilde{}$Domain();}  \\
Invokes delete on all the storage objects. This means that, if the two
latter constructors have been called, the container objects must have 
been created using {\em new} and that at no other point in the program
is the destructor invoked on these objects. It should be noted, that
the objects in the Domain, i.e. the DomainComponents, are not
destroyed. To clean up these objects {\em clearAll()} should be
invoked before the destructor is called. \\

%%%%%%%% Public Member Functions - POPULATION
\noindent {\bf Public Methods to Populate the Domain}  \\
\indent {\em virtual bool addElement(Element *theElementPtr);}  \\
To add the element pointed to by theElementPtr to the domain. 
If {\em \_DEBUG} is defined the domain checks to
see that: 1) that all external nodes for the element exists in the
domain. and 2) that the sum of the dof at all the nodes equals the num
of dof at the element. In addition the domain always checks to ensure
that no other element with a similar tag exists in the domain.
If the checks are successful, the element is added to
the domain by the domain invoking {\em addComponent(theElePtr)} on
the container for the elements. The domain then invokes {\em
setDomain(this)} on the element and {\em domainChange()} on
itself if the element is successfully added. The call returns {\em
true} if the element is added, otherwise the {\em warning()} method of
the global ErrorHandler is invoked and {\em false} is returned.\\

{\em virtual bool addNode(Node *theNodePtr = false);}  \\
To add the node pointed to by {\em theNodePtr} to the domain. 
The domain first checks that no other node with a similar tag,
node number, has been previously added to the domain. The
domain will then add the node to it's node container object, by
invoking {\em addComponent(theNodePtr)}. If successful, the Domain
invokes {\em setDomain(this)} on the node, {\em domainChange()} on
itself, and checks the coordinates of the domain to see if they effect
the box encompassing the Domain. The call returns {\em true} if the
node was added, otherwise the {\em warning()} method of
the global ErrorHandler is invoked and {\em false} is returned.\\


{\em virtual bool addSP(SP\_Constraint *theSPptr = false);}  \\
To add the single point constraint pointed to by theSPptr to the
domain. If {\em \_DEBUG} is defined the domain is responsible for
checking to see that 1) the constrained node exists in the domain and
2) that the node has the dof that is to be constrained. 
In addition the domain always checks to ensure that no other
constraint with a similar tag exists in the domain. If the checks are
successful, the constraint is added to domain by the domain invoking {\em
addComponent(theSPptr)} on the container for the SP\_Constraints. The
domain then invokes {\em setDomain(this)} on the 
constraint and {\em domainChange()} on itself. The call returns {\em
true} if the constraint was added, otherwise the {\em warning()} method of
the global ErrorHandler is invoked and {\em false} is returned.\\



{\em virtual bool addMP(MP\_Constraint *theMPptr = false);}  \\
To add the multiple point constraint pointed to by theMPptr, to the
domain. If {\em \_DEBUG} is defined the domain first
checks to see that the retained and the constrained node both exist
in the model and that the matrix is of proper dimensions (THIS LAST
PART NOT YET IMPLEMENTED). 
In addition the domain always checks to ensure that no other
MP\_Constraint with a similar tag exists in the domain. If the checks are
successful, the constraint is added to domain by the domain invoking {\em
addComponent(theMPptr)} on the container for the MP\_Constraints. The
domain then invokes {\em setDomain(this)} on the 
constraint and {\em domainChange()} on itself. The call returns {\em
true} if the constraint was added, otherwise the {\em warning()} method of
the global ErrorHandler is invoked and {\em false} is returned.\\


{\em virtual bool addLoadPattern(LoadPattern *thePattern);}  \\ 
To add the LoadPattern {\em thePattern} to the domain.
The load is added to domain by the domain invoking {\em
addComponent(theLd)} on the container for the LoadPatterns. The domain
is responsible for invoking {\em setDomain(this)} on the load. The
call returns {\em true} if the load was added, otherwise the {\em
warning()} method of the global ErrorHandler is invoked and {\em
false} is returned.\\ 

{\em virtual bool addNodalLoad(NodalLoad *theLd, int loadPatternTag);}  \\ 
To add the nodal load {\em theld} to the LoadPattern in the domain
whose tag is given by {\em loadPatternTag}.
If {\em \_DEBUG} is defines, checks to see that corresponding node
exists in the domain. A pointer to the LoadPattern is obtained from
the LoadPattern container and the load is added to LoadPattern by
invoking {\em addNodalLoad(theLd)} on the LoadPattern object. The
domain is responsible for invoking {\em setDomain(this)} on the
load. The call returns {\em true} if the load was added, otherwise the
{\em warning()} method on the global ErrorHandler is invoked and {\em
false} is returned.\\ 


{\em virtual bool addElementalLoad(ElementalLoad *theLd, int loadPatternTag);}  \\ 
To add the elemental load {\em theld} to the LoadPattern in the domain
whose tag is given by {\em loadPatternTag}.
If {\em \_DEBUG} is defines, checks to see that corresponding element
exists in the domain. A pointer to the LoadPattern is obtained from
the LoadPattern container and the load is added to LoadPattern by
invoking {\em addElementalLoad(theLd)} on the LoadPattern object. The
domain is responsible for invoking {\em setDomain(this)} on the
load. The call returns {\em true} if the load was added, otherwise the
{\em warning()} method on the global ErrorHandler is invoked and {\em
false} is returned.\\ 


{\em virtual bool addSP\_Constraint(SP\_Constraint *theConstraint, int
loadPatternTag);}  \\  
To add the elemental load {\em theConstraint} to the LoadPattern in the domain
whose tag is given by {\em loadPatternTag}.
If {\em \_DEBUG} is defines, checks to see that corresponding node
exists in the domain. A pointer to the LoadPattern is obtained from
the LoadPattern container and the load is added to LoadPattern by
invoking {\em addSP\_Constraint(theConstraint)} on the LoadPattern object. The
domain is responsible for invoking {\em setDomain(this)} on the
constraint. The call returns {\em true} if the load was added, otherwise the
{\em warning()} method on the global ErrorHandler is invoked and {\em
false} is returned.\\ 


\noindent {\bf Public Methods to Depopulate the Domain}  \\
\indent{\em virtual void clearAll(void);}\\
To remove all the components from the model and invoke the destructor
on these objects. First {\em clearAll()} is invoked on all the
LoadPattern objects. Then the domain object invokes {\em
clearAll()} on its container objects. In addition the destructor for
each Recorder object that has been added to the domain is invoked. In
addition the current time and load factor are set to $0$, and the box
bounding the domain is set to the box enclosing the origin. \\


\indent{\em virtual Element *removeElement(int tag);}\\
To remove the element whose tag is given by {\em tag} from the
domain. The domain achieves this by invoking {\em
removeComponent(tag)} on the container for the elements. 
Returns $0$ if no such element exists in the domain. Otherwise 
the domain invokes {\em setDomain(0)} on the element (using a cast to
go from a TaggedObject to an Element, which is safe as only an
Element objects are added to this container) and {\em
domainChange()} on itself before a pointer to the element is returned. \\

{\em virtual Node *removeNode(int tag);}\\    
To remove the node whose tag is given by {\em tag} from the domain. 
The domain achieves this by invoking {\em
removeComponent(tag)} on the container for the nodes. 
Returns $0$ if no such node exists in the domain. If the node is to be
removed the domain invokes {\em setDomain(0)} on the node and {\em
domainChange()} on itself before a pointer to the Node is returned.\\ 

{\em virtual SP\_Constraint *removeSP\_Constraint(int tag);}\\
To remove the SP\_Constraint whose tag is given by {\em tag} from the
domain. The domain achieves this by invoking {\em
removeComponent(tag)} on the container for the single point
constraints. Returns $0$ if the constraint was not in the domain,
otherwise the domain invokes {\em setDomain(0)} on the constraint and
{\em domainChange()} on itself before a pointer to the constraint is
returned. Note this will only remove SP\_Constraints which have been
added to the domain and not directly to LoadPatterns.\\

{\em virtual MP\_Constraint *removeMP\_Constraint(int tag);} \\
To remove the MP\_Constraint whose tag is given by {\em tag} from the
domain. The domain achieves this by invoking {\em
removeComponent(tag)} on the container for the multi point
constraints. Returns $0$ if the constraint was not in the domain,
otherwise the domain invokes {\em setDomain(0)} on the constraint and
{\em domainChange()} on itself before a pointer to the constraint is
returned.\\   

{\em virtual LoadPattern *removeLoadPattern(int tag);}\\         
To remove the LoadPattern whose tag is given by {\em tag} from the
domain. The domain achieves this by invoking {\em
removeComponent(tag)} on the container for the load patterns. 
If the LoadPattern exists, the domain then iterates through the loads
and constraints of the LoadPattern invoking {\em setDomain(0)} on
these objects. Returns
$0$ if the load was not in the domain, otherwise returns a pointer to
the load that was removed. Invokes {\em setDomain(0)} on the load case
before it is returned.\\ 


%%%%%%%% Public Member Functions - ACCESS
\noindent {\bf Public Methods to Access the Components of the Domain}  \\
\indent {\em virtual ElementIter \&getElements(void);} \\
To return an iter for the Elements in the domain. It returns an {\em
ElementIter} for the elements of the domain that were added using {\em
addElement()}. \\  

{\em virtual NodeIter \&getNodes(void);} \\
It returns a {\em NodeIter} for the nodes which have been added to the
domain. \\ 

{\em virtual SP\_ConstraintIter \&getSPs(void);} \\
To return an {\em SP\_ConstraintIter} for the single point constraints
which have been added to the domain. \\ 

{\em virtual MP\_ConstraintIter \&getMPs(void);} \\
To return an {\em MP\_ConstraintIter} for the multiple point
constraints which have been added to the domain. \\ 

{\em virtual LoadPatternIter \&getLoadPatterns(void);} \\
To return an {\em LoadPatternIter} for the LoadPattern
objects which have been added to the domain. \\ 

{\em virtual  Element *getElement(int tag);}\\
To return a pointer to the element {\em tag}. If no such element
exists $0$ is returned. It does this by invoking {em
getComponentPtr(tag)} on the element container and performing a cast
to an element if the object exists. \\

{\em virtual  Node *getNode(int tag);}\\
To return a pointer to the node whose tag is given by {\em tag}. If
no such node exists $0$ is returned. It does this by invoking {em
getComponentPtr(tag)} on the node container and performing a cast
to a node if the object exists. \\

{\em virtual  SP\_Constraint *getSP\_ConstraintPtr(int tag);}\\
To return a pointer to the SP\_Constraint whose tag is given by {\em tag}. If
no such SP\_Constraint exists $0$ is returned. It does this by invoking {em
getComponentPtr(tag)} on the single-point constraint container and
performing a cast to an SP\_Constraint if the object exists. \\


{\em virtual  MP\_Constraint *getMP\_ConstraintPtr(int tag);}\\
To return a pointer to the MP\_Constraint whose tag is given by {\em tag}. If
no such MP\_Constraint exists $0$ is returned. It does this by invoking {em
getComponentPtr(tag)} on the multi-point constraint container and
performing a cast to an MP\_Constraint if the object exists. \\


{\em virtual  ElementalLoad *getLoadPattern(int tag);}\\
To return a pointer to the LoadPattern whose tag is given by {\em tag}. If
no such LoadPattern exists $0$ is returned. It does this by invoking {em
getComponentPtr(tag)} on the elemental load container and
performing a cast to a LoadPattern if the object exists. \\


%%%%%%%% Public Member Functions - QUERY
\noindent {\bf Public Methods to Query the Domain} \\
\indent {\em virtual int getNumElements(void) const;}\\
To return the number of elements in the domain. It does this by
invoking {\em getNumComponents()} on the container for the elements. \\

{\em virtual int getNumNodes(void) const;}\\
To return the number of nodes in the domain. It does this by
invoking {\em getNumComponents()} on the container for the
nodes. \\

{\em virtual int getNumSPs(void) const;}\\
To return the number of single point constraints in the domain. It
does this by invoking {\em getNumComponents()} on the container for
the single point constraints. \\

{\em virtual int getNumMPs(void) const;}\\
To return the number of multi point constraints in the domain. It
does this by invoking {\em getNumComponents()} on the container for
the multi point constraints. \\

{\em virtual int getNumLoadPatterns(void) const;}\\
To return the number of load patterns in the domain. It
does this by invoking {\em getNumComponents()} on the container for
the load patterns. \\

{\em virtual const Vector \&getPhysicalBounds(void);} \\
To return the bounding rectangle for the Domain. The information is
contained in a Vector of size 6 containing in the following order
\{xmin, ymin, zmin, xmax, ymax, zmax\}. This information is built up
as nodes are added to the domain, initially all are set to $0$ in the
constructor. \\

{\em virtual Graph \&getElementGraph(void);} \\
Returns the current element graph (the connectivity of the elements
in the domain). If the {\em eleChangeFlag} has been set
to {\em true} the method will invoke {\em buildEleGraph(theEleGraph)}
on itself before returning the graph. The vertices in the element
graph are to be labeled $0$ through $numEle-1$. The Vertices references
contain the elemental tags. \\ 

{\em virtual Graph \&getNodeGraph(void);} \\
Returns the current node graph (the connectivity of the nodes in
the domain). If the {\em nodeChangeFlag} has been set to {\em true} the
will invoke {\em buildNodeGraph(theNodeGraph)} on itself before
returning the graph. The vertices in the node graph are to be labeled
$0$ through $numNode-1$. The Vertices references contain the nodal tags. \\ 


%%%%%%%% Public Member Functions - UPDATE
\noindent {\bf Public Methods to Update the Domain}  \\
\indent {\em virtual setCommitTag(int newTag);} \\
To set the current commitTag to {\em newTag}. \\

\indent {\em virtual setCurrentTime(double newTime);} \\
To set the current time to {\em newTime}. \\

\indent {\em virtual setCommittedTime(double newTime);} \\
To set the committed time to {\em newTime}. \\

\indent {\em virtual void applyLoad(double pseudoTime);} \\ 
To apply the loads for the given time {\em pseudoTime}. The domain
first clears the current load at all nodes and elements, done by
invoking {\em zeroUnbalancedLoad()} on each node and {\em zeroLoad()}
on each element. The domain then invokes {\em applyLoad(pseudoTime)}
on all LoadPatterns which have been added to the domain. The domain
will then invoke {\em applyConstraint(pseudoTime)} on all the
constraints in the single and multi point constraint
containers. Finally the domain sets its current time to be {\em
pseudoTime}.\\  

\indent {\em virtual setLoadConstant(void);} \\
To set the loads in the LoadPatterns to be constant. The domain
achieves this by invoking {\em setLoadConstant()} on all the
LoadPatterns which have been added to the domain. Note that
LoadPatterns added after this method has been invoked will not be
constant until this method is invoked again. \\


{\em virtual void commit(void);} \\
To commit the state of the domain , that is to accept the current
state as being ion the solution path. The domain invokes {\em
commit()} on all nodes in the domain and then {\em 
commit()} on all elements of the domain. These are calls for the nodes
and elements to set there committed state as given by their current
state. The domain will then set its committed time variable to be
equal to the current time and lastly increments its commit tag by $1$. \\ 


{\em virtual int revertToLastCommit(void);} \\
To return the domain to the state it was in at the last commit. The
domain invokes {\em revertToLastCommit()} on all nodes and elements in
the domain. The domain sets its current loadFactor and time
stamp to be equal to the last committed values. The domain decrements
the current commitTag by $1$. Finally it invokes {\em applyLoad()}
on itself with the current time.\\

{\em virtual void update(void);} \\
Called by the AnalysisModel to update the state of the
domain. Iterates over all the elements of the Domain and invokes {\em
update()}. \\

\indent {\em virtual void setDomainChangeStamp(int newStamp);}\\
To set the domain stamp to be {\em newStamp}. Domain stamp is the
integer returned by {\em hasDomainChanged()}. \\

\noindent {\bf Public Methods for the Analysis} \\
{\em virtual int hasDomainChanged(void);} \\
To return an integer stamp indicating the state of the
domain. Initially $0$, this integer is incremented by $1$ if  {\em
domainChange()} has been invoked since the last invocation of the
method. If the domain has changed it marks the element and node graph
flags as not having been built.\\  

\noindent {\bf Public Methods for Output} \\
\indent {\em  virtual int  addRecorder(Recorder \&theRecorder);}\\
To add a recorder object {\em theRecorder} to the domain. {\em
record(commitTag)} is invoked on each {\em commit()}. The pointers to
the recorders are stored in an array which is resized on each
invocation of this method.\\  

\indent {\em int playback(int commitTag);}\\
The domain will invoke {\em playback(commitTag)} on all recorder
objects which have been added to the domain.\\

\indent {\em virtual void Print(OPS_Stream \&s, int flag =0);}\\
To print the state of the domain. The domain invokes {\em Print(s,flag)} on
all it's container objects. \\


\indent {\em friend OPS_Stream \&operator$<<$(OPS_Stream \&s, Domain \&M); }\\  
This function allows domain objects to be printed to streams. The
function invokes $M.Print(s)$ before returning $s$. \\

\noindent {\bf Protected Methods}  \\
\indent{\em virtual void domainChange(void) }\\
Sets a flag indicating that the integer returned in the next call to 
{\em hasDomainChanged()} must be incremented by $1$. This method is
invoked whenever a Node, Element or Constraint object is added to the
domain. \\ 

{\em virtual int buildEleGraph(Graph \&theEleGraph)} \\
A method which will cause the domain to discard the current element
graph and build a new one based on the element connectivity. Returns
$0$ if successful otherwise $-1$ is returned along with an error
message to opserr. \\

{\em virtual int buildNodeGraph(Graph \&theNodeGraph)} \\
A method which will cause the domain to discard the current node
graph and build a new one based on the node connectivity. Returns
$0$ if successful otherwise $-1$ is returned along with an error
message to opserr. \\





