Skip to content

Reply To: Creating an IndicatorF from density

#8574
avrachan1
Participant

Dear Adrian,

Thank you for your reply.

I made the following class

129 template <typename T, typename DESCRIPTOR>
130 class myindicator : public SuperIndicatorF3D<T>
131 {
132 private :
133 SuperLattice<T,DESCRIPTOR>& sLattice;
134 public :
135 myindicator(SuperLattice<T,DESCRIPTOR>& _sLattice, SuperGeometry<T,3>& superGeometry) : SuperIndicatorF3D<T>(superGeometry), sLattice(_sLattice)
136 {
137 ;
138 this->getName() = “myindicator”;
139 };
140
141 bool operator()(int iC,int iX,int iY,int iZ)
142 {
143 T phi=sLattice.getBlock(iC).get(iX,iY,iZ).computeRho();
144 ;
145 if(phi>0.5)
146 return true;
147 else
148 return false;
149 };
150 };
151

What I need is an object of type IndicatorF3D to give as an argument for setResolvedArbitraryShape3D().

Therefore I need to give (x,y,z) and get a true/false in return.

But without the cuboid number, I cannot access the lattice site corresponding to (x,y,z).

Am I understanding this correctly? How to go about this?

Thanks again.

PS: How do you paste code in this forum ?