AbstractStimulusFactory.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036 #include "AbstractStimulusFactory.hpp"
00037 #include "ZeroStimulus.hpp"
00038
00039
00040 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00041 boost::shared_ptr<AbstractStimulusFunction> AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::CreateStimulusForNode(Node<SPACE_DIM>* pNode)
00042 {
00043
00044 boost::shared_ptr<ZeroStimulus> p_stim ( new ZeroStimulus() );
00045 return p_stim;
00046 }
00047
00048 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00049 unsigned AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::GetNumberOfCells()
00050 {
00051 assert(mpMesh != NULL);
00052 return mpMesh->GetNumNodes();
00053 }
00054
00055 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00056 AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::AbstractStimulusFactory()
00057 : mpMesh(NULL)
00058 {
00059
00060 }
00061
00062 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00063 AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::~AbstractStimulusFactory()
00064 {
00065 }
00066
00067 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00068 void AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::SetMesh(AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* pMesh)
00069 {
00070 mpMesh = pMesh;
00071 }
00072
00073 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00074 void AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::SetCompatibleExtracellularStimulus()
00075 {
00076
00077 }
00078
00079 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00080 AbstractTetrahedralMesh<ELEMENT_DIM,SPACE_DIM>* AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::GetMesh()
00081 {
00082 if (mpMesh == NULL)
00083 {
00084 EXCEPTION("The mesh object has not been set in the stimulus factory");
00085 }
00086 return mpMesh;
00087 }
00088
00089
00090
00091
00092
00093
00094
00095 template<unsigned ELEMENT_DIM, unsigned SPACE_DIM>
00096 std::vector<AbstractChasteRegion<SPACE_DIM>* > AbstractStimulusFactory<ELEMENT_DIM,SPACE_DIM>::GetRegionsToBeGrounded()
00097 {
00098 return mGroundedRegions;
00099 }
00100
00102
00104
00105 template class AbstractStimulusFactory<1,1>;
00106 template class AbstractStimulusFactory<2,2>;
00107 template class AbstractStimulusFactory<3,3>;