/[escript]/branches/ripleygmg_from_3668/ripley/src/RipleyDomain.cpp
ViewVC logotype

Annotation of /branches/ripleygmg_from_3668/ripley/src/RipleyDomain.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3732 - (hide annotations)
Fri Dec 9 01:47:28 2011 UTC (7 years, 10 months ago) by caltinay
File size: 26529 byte(s)
Implemented probeInterpolationOnDomain().

1 caltinay 3670
2     /*******************************************************
3     *
4     * Copyright (c) 2003-2011 by University of Queensland
5     * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13    
14     #include <ripley/RipleyDomain.h>
15     #include <escript/DataFactory.h>
16 caltinay 3691 #include <escript/FunctionSpaceFactory.h>
17     #include <pasowrap/SystemMatrixAdapter.h>
18     #include <pasowrap/TransportProblemAdapter.h>
19 caltinay 3670
20     #include <iomanip>
21    
22     using namespace std;
23 caltinay 3691 using paso::SystemMatrixAdapter;
24     using paso::TransportProblemAdapter;
25 caltinay 3670
26     namespace ripley {
27    
28 caltinay 3691 escript::Domain_ptr RipleyDomain::loadMesh(const string& filename)
29 caltinay 3670 {
30 caltinay 3691 throw RipleyException("loadMesh() not implemented");
31 caltinay 3670 }
32    
33 caltinay 3691 escript::Domain_ptr RipleyDomain::readMesh(const string& filename)
34 caltinay 3670 {
35 caltinay 3691 throw RipleyException("readMesh() not implemented");
36 caltinay 3670 }
37    
38 caltinay 3691 RipleyDomain::RipleyDomain(dim_t dim) :
39     m_numDim(dim),
40     m_status(0)
41 caltinay 3670 {
42 caltinay 3691 m_mpiInfo = Esys_MPIInfo_alloc(MPI_COMM_WORLD);
43 caltinay 3670 }
44    
45 caltinay 3691 RipleyDomain::~RipleyDomain()
46 caltinay 3670 {
47 caltinay 3691 Esys_MPIInfo_free(m_mpiInfo);
48 caltinay 3670 }
49    
50 caltinay 3691 bool RipleyDomain::isValidFunctionSpaceType(int fsType) const
51 caltinay 3670 {
52 caltinay 3691 switch (fsType) {
53 caltinay 3670 case DegreesOfFreedom:
54     case ReducedDegreesOfFreedom:
55     case Nodes:
56     case ReducedNodes:
57     case Elements:
58     case ReducedElements:
59     case FaceElements:
60     case ReducedFaceElements:
61     case Points:
62 caltinay 3691 return true;
63     default:
64 caltinay 3670 break;
65     }
66 caltinay 3691 return false;
67 caltinay 3670 }
68    
69 caltinay 3691 string RipleyDomain::functionSpaceTypeAsString(int fsType) const
70 caltinay 3670 {
71 caltinay 3691 switch (fsType) {
72     case DegreesOfFreedom: return "Ripley_DegreesOfFreedom";
73     case ReducedDegreesOfFreedom: return "Ripley_ReducedDegreesOfFreedom";
74     case Nodes: return "Ripley_Nodes";
75     case ReducedNodes: return "Ripley_Reduced_Nodes";
76     case Elements: return "Ripley_Elements";
77     case ReducedElements: return "Ripley_Reduced_Elements";
78     case FaceElements: return "Ripley_Face_Elements";
79     case ReducedFaceElements: return "Ripley_Reduced_Face_Elements";
80     case Points: return "Ripley_Points";
81     default:
82 caltinay 3670 break;
83     }
84 caltinay 3691 return "Invalid function space type code";
85 caltinay 3670 }
86    
87 caltinay 3691 pair<int,int> RipleyDomain::getDataShape(int fsType) const
88 caltinay 3670 {
89 caltinay 3691 const int ptsPerSample = (m_numDim==2 ? 4 : 8);
90     switch (fsType) {
91 caltinay 3670 case Nodes:
92 caltinay 3713 case ReducedNodes:
93 caltinay 3670 case DegreesOfFreedom:
94 caltinay 3722 case ReducedDegreesOfFreedom:
95 caltinay 3691 return pair<int,int>(1, getNumNodes());
96 caltinay 3670 case Elements:
97 caltinay 3691 return pair<int,int>(ptsPerSample, getNumElements());
98 caltinay 3670 case FaceElements:
99 caltinay 3691 return pair<int,int>(ptsPerSample/2, getNumFaceElements());
100 caltinay 3711 case ReducedElements:
101     return pair<int,int>(1, getNumElements());
102     case ReducedFaceElements:
103     return pair<int,int>(1, getNumFaceElements());
104 caltinay 3691 /*
105 caltinay 3697 case Points:
106 caltinay 3711 return pair<int,int>(1, getNumPoints());
107 caltinay 3691 */
108 caltinay 3670 default:
109     break;
110     }
111    
112 caltinay 3691 stringstream msg;
113 caltinay 3702 msg << "getDataShape(): Unsupported function space type "
114     << functionSpaceTypeAsString(fsType) << " for " << getDescription();
115 caltinay 3691 throw RipleyException(msg.str());
116 caltinay 3670 }
117    
118 caltinay 3691 string RipleyDomain::showTagNames() const
119 caltinay 3670 {
120 caltinay 3691 stringstream ret;
121     TagMap::const_iterator it;
122     for (it=m_tagMap.begin(); it!=m_tagMap.end(); it++) {
123     if (it!=m_tagMap.begin()) ret << ", ";
124     ret << it->first;
125 caltinay 3670 }
126 caltinay 3691 return ret.str();
127 caltinay 3670 }
128    
129     bool RipleyDomain::commonFunctionSpace(const vector<int>& fs, int& resultcode) const
130     {
131 caltinay 3691 /*
132     The idea is to use equivalence classes (i.e. types which can be
133     interpolated back and forth):
134 caltinay 3670 class 1: DOF <-> Nodes
135     class 2: ReducedDOF <-> ReducedNodes
136     class 3: Points
137     class 4: Elements
138     class 5: ReducedElements
139     class 6: FaceElements
140     class 7: ReducedFaceElements
141     class 8: ContactElementZero <-> ContactElementOne
142     class 9: ReducedContactElementZero <-> ReducedContactElementOne
143    
144 caltinay 3691 There is also a set of lines. Interpolation is possible down a line but not
145     between lines.
146     class 1 and 2 belong to all lines so aren't considered.
147 caltinay 3670 line 0: class 3
148     line 1: class 4,5
149     line 2: class 6,7
150     line 3: class 8,9
151    
152     For classes with multiple members (eg class 2) we have vars to record if
153     there is at least one instance. e.g. hasnodes is true if we have at least
154     one instance of Nodes.
155     */
156     if (fs.empty())
157     return false;
158     vector<int> hasclass(10);
159     vector<int> hasline(4);
160     bool hasnodes=false;
161     bool hasrednodes=false;
162     for (int i=0;i<fs.size();++i) {
163     switch (fs[i]) {
164     case Nodes: hasnodes=true; // no break is deliberate
165     case DegreesOfFreedom:
166     hasclass[1]=1;
167     break;
168     case ReducedNodes: hasrednodes=true; // no break is deliberate
169     case ReducedDegreesOfFreedom:
170     hasclass[2]=1;
171     break;
172     case Points:
173     hasline[0]=1;
174     hasclass[3]=1;
175     break;
176     case Elements:
177     hasclass[4]=1;
178     hasline[1]=1;
179     break;
180     case ReducedElements:
181     hasclass[5]=1;
182     hasline[1]=1;
183     break;
184     case FaceElements:
185     hasclass[6]=1;
186     hasline[2]=1;
187     break;
188     case ReducedFaceElements:
189     hasclass[7]=1;
190     hasline[2]=1;
191     break;
192     default:
193     return false;
194     }
195     }
196     int totlines=hasline[0]+hasline[1]+hasline[2]+hasline[3];
197    
198     // fail if we have more than one leaf group
199     // = there are at least two branches we can't interpolate between
200     if (totlines>1)
201     return false;
202     else if (totlines==1) {
203     // we have points
204 caltinay 3691 if (hasline[0]==1)
205 caltinay 3670 resultcode=Points;
206 caltinay 3691 else if (hasline[1]==1) {
207     if (hasclass[5]==1)
208 caltinay 3670 resultcode=ReducedElements;
209 caltinay 3691 else
210 caltinay 3670 resultcode=Elements;
211     } else if (hasline[2]==1) {
212 caltinay 3691 if (hasclass[7]==1)
213 caltinay 3670 resultcode=ReducedFaceElements;
214 caltinay 3691 else
215 caltinay 3670 resultcode=FaceElements;
216 caltinay 3691 } else
217     throw RipleyException("Internal Ripley Error!");
218 caltinay 3670 } else { // totlines==0
219 caltinay 3691 if (hasclass[2]==1)
220 caltinay 3670 // something from class 2
221     resultcode=(hasrednodes ? ReducedNodes : ReducedDegreesOfFreedom);
222 caltinay 3691 else // something from class 1
223 caltinay 3670 resultcode=(hasnodes ? Nodes : DegreesOfFreedom);
224     }
225     return true;
226     }
227    
228 caltinay 3732 bool RipleyDomain::probeInterpolationOnDomain(int fsType_source,
229     int fsType_target) const
230     {
231     if (fsType_target != Nodes &&
232     fsType_target != ReducedNodes &&
233     fsType_target != ReducedDegreesOfFreedom &&
234     fsType_target != DegreesOfFreedom &&
235     fsType_target != Elements &&
236     fsType_target != ReducedElements &&
237     fsType_target != FaceElements &&
238     fsType_target != ReducedFaceElements &&
239     fsType_target != Points) {
240     stringstream msg;
241     msg << "probeInterpolationOnDomain(): Invalid functionspace type "
242     << fsType_target;
243     throw RipleyException(msg.str());
244     }
245    
246     switch (fsType_source) {
247     case Nodes:
248     case DegreesOfFreedom:
249     return true;
250     case ReducedNodes:
251     case ReducedDegreesOfFreedom:
252     return (fsType_target != Nodes &&
253     fsType_target != DegreesOfFreedom);
254     case Elements:
255     return (fsType_target==Elements ||
256     fsType_target==ReducedElements);
257     case ReducedElements:
258     return (fsType_target==ReducedElements);
259     case FaceElements:
260     return (fsType_target==FaceElements ||
261     fsType_target==ReducedFaceElements);
262     case ReducedFaceElements:
263     return (fsType_target==ReducedFaceElements);
264     case Points:
265     return (fsType_target==Points);
266    
267     default: {
268     stringstream msg;
269     msg << "probeInterpolationOnDomain(): Invalid functionspace type "
270     << fsType_source;
271     throw RipleyException(msg.str());
272     }
273     }
274     }
275    
276 caltinay 3701 void RipleyDomain::interpolateOnDomain(escript::Data& target,
277     const escript::Data& in) const
278     {
279     const RipleyDomain& inDomain=dynamic_cast<const RipleyDomain&>(*(in.getFunctionSpace().getDomain()));
280     const RipleyDomain& targetDomain=dynamic_cast<const RipleyDomain&>(*(target.getFunctionSpace().getDomain()));
281     if (inDomain != *this)
282     throw RipleyException("Illegal domain of interpolant");
283     if (targetDomain != *this)
284     throw RipleyException("Illegal domain of interpolation target");
285    
286     stringstream msg;
287     msg << "interpolateOnDomain() not implemented for function space "
288     << functionSpaceTypeAsString(in.getFunctionSpace().getTypeCode())
289     << " -> "
290     << functionSpaceTypeAsString(target.getFunctionSpace().getTypeCode());
291    
292     switch (in.getFunctionSpace().getTypeCode()) {
293     case Nodes:
294 caltinay 3722 case ReducedNodes:
295 caltinay 3701 case DegreesOfFreedom:
296 caltinay 3722 case ReducedDegreesOfFreedom:
297 caltinay 3701 switch (target.getFunctionSpace().getTypeCode()) {
298 caltinay 3722 case Nodes:
299     case ReducedNodes:
300 caltinay 3701 case DegreesOfFreedom:
301 caltinay 3722 case ReducedDegreesOfFreedom:
302     // FIXME
303     copyNodalData(target, *const_cast<escript::Data*>(&in));
304 caltinay 3701 break;
305    
306     case Elements:
307 caltinay 3711 interpolateNodesOnElements(target, *const_cast<escript::Data*>(&in), false);
308 caltinay 3701 break;
309    
310 caltinay 3711 case ReducedElements:
311     interpolateNodesOnElements(target, *const_cast<escript::Data*>(&in), true);
312     break;
313    
314 caltinay 3701 case FaceElements:
315 caltinay 3711 interpolateNodesOnFaces(target, *const_cast<escript::Data*>(&in), false);
316 caltinay 3701 break;
317    
318 caltinay 3711 case ReducedFaceElements:
319     interpolateNodesOnFaces(target, *const_cast<escript::Data*>(&in), true);
320     break;
321    
322 caltinay 3701 default:
323     throw RipleyException(msg.str());
324     }
325     break;
326     default:
327     throw RipleyException(msg.str());
328     }
329     }
330    
331 caltinay 3691 escript::Data RipleyDomain::getX() const
332 caltinay 3670 {
333 caltinay 3691 return escript::continuousFunction(*this).getX();
334     }
335    
336     escript::Data RipleyDomain::getNormal() const
337     {
338     return escript::functionOnBoundary(*this).getNormal();
339     }
340    
341     escript::Data RipleyDomain::getSize() const
342     {
343     return escript::function(*this).getSize();
344     }
345    
346     void RipleyDomain::setToX(escript::Data& arg) const
347     {
348     const RipleyDomain& argDomain=dynamic_cast<const RipleyDomain&>(
349     *(arg.getFunctionSpace().getDomain()));
350     if (argDomain != *this)
351     throw RipleyException("setToX: Illegal domain of data point locations");
352     if (!arg.isExpanded())
353     throw RipleyException("setToX: Expanded Data object expected");
354    
355     if (arg.getFunctionSpace().getTypeCode()==Nodes) {
356     assembleCoordinates(arg);
357     } else {
358     // interpolate the result
359     escript::Data contData=escript::Vector(0., escript::continuousFunction(*this), true);
360     assembleCoordinates(contData);
361     interpolateOnDomain(arg, contData);
362 caltinay 3670 }
363 caltinay 3691 }
364 caltinay 3670
365 caltinay 3691 bool RipleyDomain::isCellOriented(int fsType) const
366     {
367     switch(fsType) {
368 caltinay 3670 case Nodes:
369     case DegreesOfFreedom:
370     case ReducedDegreesOfFreedom:
371 caltinay 3691 return false;
372 caltinay 3670 case Elements:
373 caltinay 3691 case FaceElements:
374     case Points:
375 caltinay 3670 case ReducedElements:
376     case ReducedFaceElements:
377 caltinay 3691 return true;
378 caltinay 3670 default:
379 caltinay 3691 break;
380 caltinay 3670 }
381 caltinay 3691 stringstream msg;
382 caltinay 3722 msg << "isCellOriented(): Illegal function space type " << fsType << " on " << getDescription();
383 caltinay 3691 throw RipleyException(msg.str());
384 caltinay 3670 }
385    
386 caltinay 3722 bool RipleyDomain::canTag(int fsType) const
387     {
388     switch(fsType) {
389     case Nodes:
390     case Elements:
391     case ReducedElements:
392     case FaceElements:
393     case ReducedFaceElements:
394     return true;
395     case DegreesOfFreedom:
396     case ReducedDegreesOfFreedom:
397     case Points:
398     return false;
399     default:
400     break;
401     }
402     stringstream msg;
403     msg << "canTag(): Illegal function space type " << fsType << " on " << getDescription();
404     throw RipleyException(msg.str());
405     }
406    
407     void RipleyDomain::setTags(const int fsType, const int newTag, const escript::Data& cMask) const
408     {
409     IndexVector* target=NULL;
410     dim_t num=0;
411    
412     switch(fsType) {
413     case Nodes:
414     num=getNumNodes();
415     target=&m_nodeTags;
416     break;
417     case Elements:
418     case ReducedElements:
419     num=getNumElements();
420     target=&m_elementTags;
421     break;
422     case FaceElements:
423     case ReducedFaceElements:
424     num=getNumFaceElements();
425     target=&m_faceTags;
426     break;
427     default: {
428     stringstream msg;
429     msg << "setTags(): not implemented for " << functionSpaceTypeAsString(fsType);
430     throw RipleyException(msg.str());
431     }
432     }
433     if (target->size() != num) {
434     target->assign(num, -1);
435     }
436    
437     escript::Data& mask=*const_cast<escript::Data*>(&cMask);
438     #pragma omp parallel for
439     for (index_t i=0; i<num; i++) {
440     if (mask.getSampleDataRO(i)[0] > 0) {
441     (*target)[i]=newTag;
442     }
443     }
444     updateTagsInUse(fsType);
445     }
446    
447     int RipleyDomain::getTagFromSampleNo(int fsType, int sampleNo) const
448     {
449     switch(fsType) {
450     case Nodes:
451     if (m_nodeTags.size() > sampleNo)
452     return m_nodeTags[sampleNo];
453     break;
454     case Elements:
455     case ReducedElements:
456     if (m_elementTags.size() > sampleNo)
457     return m_elementTags[sampleNo];
458     break;
459     case FaceElements:
460     case ReducedFaceElements:
461     if (m_faceTags.size() > sampleNo)
462     return m_faceTags[sampleNo];
463     break;
464     default: {
465     stringstream msg;
466     msg << "getTagFromSampleNo(): not implemented for " << functionSpaceTypeAsString(fsType);
467     throw RipleyException(msg.str());
468     }
469     }
470     return -1;
471     }
472    
473     int RipleyDomain::getNumberOfTagsInUse(int fsType) const
474     {
475     switch(fsType) {
476     case Nodes:
477     return m_nodeTagsInUse.size();
478     case Elements:
479     case ReducedElements:
480     return m_elementTagsInUse.size();
481     case FaceElements:
482     case ReducedFaceElements:
483     return m_faceTagsInUse.size();
484     default: {
485     stringstream msg;
486     msg << "getNumberOfTagsInUse(): not implemented for " << functionSpaceTypeAsString(fsType);
487     throw RipleyException(msg.str());
488     }
489     }
490     }
491    
492     const int* RipleyDomain::borrowListOfTagsInUse(int fsType) const
493     {
494     switch(fsType) {
495     case Nodes:
496     return &m_nodeTagsInUse[0];
497     case Elements:
498     case ReducedElements:
499     return &m_elementTagsInUse[0];
500     case FaceElements:
501     case ReducedFaceElements:
502     return &m_faceTagsInUse[0];
503     default: {
504     stringstream msg;
505     msg << "borrowListOfTagsInUse(): not implemented for " << functionSpaceTypeAsString(fsType);
506     throw RipleyException(msg.str());
507     }
508     }
509     }
510    
511 caltinay 3691 void RipleyDomain::Print_Mesh_Info(const bool full) const
512 caltinay 3670 {
513 caltinay 3691 cout << "Print_Mesh_Info for " << getDescription() << " running on CPU "
514     << m_mpiInfo->rank << ". MPI size: " << m_mpiInfo->size << endl;
515     cout << "Number of dimensions: " << m_numDim << endl;
516 caltinay 3670
517 caltinay 3691 // write tags
518     if (m_tagMap.size() > 0) {
519     cout << "Tags:" << endl;
520     TagMap::const_iterator it;
521     for (it=m_tagMap.begin(); it!=m_tagMap.end(); it++) {
522     cout << " " << setw(5) << it->second << " "
523     << it->first << endl;
524     }
525 caltinay 3670 }
526     }
527    
528     int RipleyDomain::getSystemMatrixTypeId(const int solver,
529     const int preconditioner, const int package, const bool symmetry) const
530     {
531 caltinay 3691 return SystemMatrixAdapter::getSystemMatrixTypeId(solver, preconditioner,
532     package, symmetry, m_mpiInfo);
533 caltinay 3670 }
534    
535     int RipleyDomain::getTransportTypeId(const int solver, const int preconditioner,
536     const int package, const bool symmetry) const
537     {
538 caltinay 3691 return TransportProblemAdapter::getTransportTypeId(solver, preconditioner,
539     package, symmetry, m_mpiInfo);
540 caltinay 3670 }
541    
542 caltinay 3691 escript::ASM_ptr RipleyDomain::newSystemMatrix(const int row_blocksize,
543     const escript::FunctionSpace& row_functionspace,
544     const int column_blocksize,
545     const escript::FunctionSpace& column_functionspace,
546     const int type) const
547 caltinay 3670 {
548 caltinay 3691 bool reduceRowOrder=false;
549     bool reduceColOrder=false;
550     // is the domain right?
551     const RipleyDomain& row_domain=dynamic_cast<const RipleyDomain&>(*(row_functionspace.getDomain()));
552     if (row_domain!=*this)
553     throw RipleyException("Domain of row function space does not match the domain of matrix generator");
554     const RipleyDomain& col_domain=dynamic_cast<const RipleyDomain&>(*(column_functionspace.getDomain()));
555     if (col_domain!=*this)
556     throw RipleyException("Domain of column function space does not match the domain of matrix generator");
557     // is the function space type right?
558     if (row_functionspace.getTypeCode()==ReducedDegreesOfFreedom)
559     reduceRowOrder=true;
560     else if (row_functionspace.getTypeCode()!=DegreesOfFreedom)
561     throw RipleyException("Illegal function space type for system matrix rows");
562     if (column_functionspace.getTypeCode()==ReducedDegreesOfFreedom)
563     reduceColOrder=true;
564     else if (column_functionspace.getTypeCode()!=DegreesOfFreedom)
565     throw RipleyException("Illegal function space type for system matrix columns");
566    
567     // generate matrix
568     Paso_SystemMatrixPattern* pattern=getPattern(reduceRowOrder, reduceColOrder);
569     Paso_SystemMatrix* matrix = Paso_SystemMatrix_alloc(type, pattern,
570     row_blocksize, column_blocksize, FALSE);
571     paso::checkPasoError();
572     Paso_SystemMatrixPattern_free(pattern);
573     escript::ASM_ptr sma(new SystemMatrixAdapter(matrix, row_blocksize,
574     row_functionspace, column_blocksize, column_functionspace));
575     return sma;
576 caltinay 3670 }
577    
578 caltinay 3697 void RipleyDomain::setNewX(const escript::Data& arg)
579     {
580     throw RipleyException("setNewX(): Operation not supported");
581     }
582    
583 caltinay 3722 //protected
584     void RipleyDomain::copyNodalData(escript::Data& out, escript::Data& in) const
585     {
586     const dim_t numComp = in.getDataPointSize();
587     #pragma omp parallel for
588     for (index_t i=0; i<in.getNumSamples(); i++) {
589     const double* src = in.getSampleDataRO(i);
590     copy(src, src+numComp, out.getSampleDataRW(i));
591     }
592     }
593    
594     //protected
595     void RipleyDomain::updateTagsInUse(int fsType) const
596     {
597     IndexVector* tagsInUse=NULL;
598     const IndexVector* tags=NULL;
599     switch(fsType) {
600     case Nodes:
601     tags=&m_nodeTags;
602     tagsInUse=&m_nodeTagsInUse;
603     break;
604     case Elements:
605     case ReducedElements:
606     tags=&m_elementTags;
607     tagsInUse=&m_elementTagsInUse;
608     break;
609     case FaceElements:
610     case ReducedFaceElements:
611     tags=&m_faceTags;
612     tagsInUse=&m_faceTagsInUse;
613     break;
614     default:
615     return;
616     }
617    
618     // gather global unique tag values from tags into tagsInUse
619     tagsInUse->clear();
620     index_t lastFoundValue = INDEX_T_MIN, minFoundValue, local_minFoundValue;
621    
622     while (true) {
623     // find smallest value bigger than lastFoundValue
624     minFoundValue = INDEX_T_MAX;
625     #pragma omp parallel private(local_minFoundValue)
626     {
627     local_minFoundValue = minFoundValue;
628     #pragma omp for schedule(static) nowait
629     for (size_t i = 0; i < tags->size(); i++) {
630     const index_t v = (*tags)[i];
631     if ((v > lastFoundValue) && (v < local_minFoundValue))
632     local_minFoundValue = v;
633     }
634     #pragma omp critical
635     {
636     if (local_minFoundValue < minFoundValue)
637     minFoundValue = local_minFoundValue;
638     }
639     }
640     #ifdef ESYS_MPI
641     local_minFoundValue = minFoundValue;
642     MPI_Allreduce(&local_minFoundValue, &minFoundValue, 1, MPI_INT, MPI_MIN, m_mpiInfo->comm);
643     #endif
644     // if we found a new value add it to the tagsInUse vector
645    
646     if (minFoundValue < INDEX_T_MAX) {
647     tagsInUse->push_back(minFoundValue);
648     lastFoundValue = minFoundValue;
649     } else
650     break;
651     }
652     }
653    
654 caltinay 3691 //
655     // the methods that follow have to be implemented by the subclasses
656     //
657    
658     string RipleyDomain::getDescription() const
659 caltinay 3670 {
660 caltinay 3691 throw RipleyException("getDescription() not implemented");
661 caltinay 3670 }
662    
663 caltinay 3691 bool RipleyDomain::operator==(const AbstractDomain& other) const
664 caltinay 3670 {
665 caltinay 3691 throw RipleyException("operator==() not implemented");
666 caltinay 3670 }
667    
668 caltinay 3691 void RipleyDomain::write(const string& filename) const
669 caltinay 3670 {
670 caltinay 3691 throw RipleyException("write() not implemented");
671 caltinay 3670 }
672    
673 caltinay 3691 void RipleyDomain::dump(const string& filename) const
674 caltinay 3670 {
675 caltinay 3691 throw RipleyException("dump() not implemented");
676 caltinay 3670 }
677    
678 caltinay 3691 const int* RipleyDomain::borrowSampleReferenceIDs(int fsType) const
679     {
680     throw RipleyException("borrowSampleReferenceIDs() not implemented");
681     }
682 caltinay 3670
683 caltinay 3691 void RipleyDomain::interpolateACross(escript::Data& target, const escript::Data& source) const
684 caltinay 3670 {
685 caltinay 3691 throw RipleyException("interpolateACross() not implemented");
686 caltinay 3670 }
687    
688 caltinay 3691 bool RipleyDomain::probeInterpolationACross(int fsType_source,
689     const escript::AbstractDomain&, int fsType_target) const
690 caltinay 3670 {
691 caltinay 3691 throw RipleyException("probeInterpolationACross() not implemented");
692 caltinay 3670 }
693    
694 caltinay 3691 void RipleyDomain::setToNormal(escript::Data& normal) const
695 caltinay 3670 {
696 caltinay 3691 throw RipleyException("setToNormal() not implemented");
697 caltinay 3670 }
698    
699 caltinay 3691 void RipleyDomain::setToSize(escript::Data& size) const
700 caltinay 3670 {
701 caltinay 3691 throw RipleyException("setToSize() not implemented");
702 caltinay 3670 }
703    
704 caltinay 3691 void RipleyDomain::setToGradient(escript::Data& grad, const escript::Data& arg) const
705 caltinay 3670 {
706 caltinay 3691 throw RipleyException("setToGradient() not implemented");
707 caltinay 3670 }
708    
709 caltinay 3691 void RipleyDomain::setToIntegrals(vector<double>& integrals, const escript::Data& arg) const
710 caltinay 3670 {
711 caltinay 3691 throw RipleyException("setToIntegrals() not implemented");
712 caltinay 3670 }
713    
714 caltinay 3691 bool RipleyDomain::ownSample(int fsType, index_t id) const
715 caltinay 3670 {
716 caltinay 3691 throw RipleyException("ownSample() not implemented");
717 caltinay 3670 }
718    
719 caltinay 3691 void RipleyDomain::addPDEToSystem(
720     escript::AbstractSystemMatrix& mat, escript::Data& rhs,
721     const escript::Data& A, const escript::Data& B, const escript::Data& C,
722     const escript::Data& D, const escript::Data& X, const escript::Data& Y,
723     const escript::Data& d, const escript::Data& y,
724     const escript::Data& d_contact, const escript::Data& y_contact,
725     const escript::Data& d_dirac,const escript::Data& y_dirac) const
726     {
727     throw RipleyException("addPDEToSystem() not implemented");
728     }
729 caltinay 3670
730 caltinay 3691 void RipleyDomain::addPDEToLumpedSystem(escript::Data& mat,
731     const escript::Data& D, const escript::Data& d,
732     const escript::Data& d_dirac, const bool useHRZ) const
733     {
734     throw RipleyException("addPDEToLumpedSystem() not implemented");
735 caltinay 3670 }
736    
737 caltinay 3691 void RipleyDomain::addPDEToRHS(escript::Data& rhs, const escript::Data& X,
738     const escript::Data& Y, const escript::Data& y,
739     const escript::Data& y_contact, const escript::Data& y_dirac) const
740 caltinay 3670 {
741 caltinay 3691 throw RipleyException("addPDEToRHS() not implemented");
742 caltinay 3670 }
743    
744 caltinay 3691 void RipleyDomain::addPDEToTransportProblem(
745     escript::AbstractTransportProblem& tp,
746     escript::Data& source, const escript::Data& M,
747     const escript::Data& A, const escript::Data& B, const escript::Data& C,
748     const escript::Data& D, const escript::Data& X, const escript::Data& Y,
749     const escript::Data& d, const escript::Data& y,
750     const escript::Data& d_contact, const escript::Data& y_contact,
751     const escript::Data& d_dirac, const escript::Data& y_dirac) const
752 caltinay 3670 {
753 caltinay 3691 throw RipleyException("addPDEToTransportProblem() not implemented");
754 caltinay 3670 }
755    
756 caltinay 3691 escript::ATP_ptr RipleyDomain::newTransportProblem(const bool useBackwardEuler,
757     const int blocksize, const escript::FunctionSpace& functionspace,
758     const int type) const
759 caltinay 3670 {
760 caltinay 3691 throw RipleyException("newTransportProblem() not implemented");
761 caltinay 3670 }
762    
763 caltinay 3691 Paso_SystemMatrixPattern* RipleyDomain::getPattern(bool reducedRowOrder,
764     bool reducedColOrder) const
765 caltinay 3670 {
766 caltinay 3691 throw RipleyException("getPattern() not implemented");
767 caltinay 3670 }
768    
769 caltinay 3691 dim_t RipleyDomain::getNumDataPointsGlobal() const
770 caltinay 3670 {
771 caltinay 3691 throw RipleyException("getNumDataPointsGlobal() not implemented");
772 caltinay 3670 }
773    
774 caltinay 3697 IndexVector RipleyDomain::getNumNodesPerDim() const
775     {
776     throw RipleyException("getNumNodesPerDim() not implemented");
777     }
778    
779     IndexVector RipleyDomain::getNumElementsPerDim() const
780     {
781     throw RipleyException("getNumElementsPerDim() not implemented");
782     }
783    
784     IndexVector RipleyDomain::getNumFacesPerBoundary() const
785     {
786     throw RipleyException("getNumFacesPerBoundary() not implemented");
787     }
788    
789     IndexVector RipleyDomain::getNodeDistribution() const
790     {
791     throw RipleyException("getNodeDistribution() not implemented");
792     }
793    
794     pair<double,double> RipleyDomain::getFirstCoordAndSpacing(dim_t dim) const
795     {
796     throw RipleyException("getFirstCoordAndSpacing() not implemented");
797     }
798    
799 caltinay 3691 dim_t RipleyDomain::getNumFaceElements() const
800 caltinay 3670 {
801 caltinay 3691 throw RipleyException("getNumFaceElements() not implemented");
802 caltinay 3670 }
803    
804 caltinay 3691 dim_t RipleyDomain::getNumElements() const
805 caltinay 3670 {
806 caltinay 3691 throw RipleyException("getNumElements() not implemented");
807 caltinay 3670 }
808    
809 caltinay 3691 dim_t RipleyDomain::getNumNodes() const
810 caltinay 3670 {
811 caltinay 3691 throw RipleyException("getNumNodes() not implemented");
812 caltinay 3670 }
813    
814 caltinay 3691 void RipleyDomain::assembleCoordinates(escript::Data& arg) const
815 caltinay 3670 {
816 caltinay 3691 throw RipleyException("assembleCoordinates() not implemented");
817 caltinay 3670 }
818    
819 caltinay 3711 void RipleyDomain::interpolateNodesOnElements(escript::Data& out, escript::Data& in, bool reduced) const
820 caltinay 3701 {
821     throw RipleyException("interpolateNodesOnElements() not implemented");
822     }
823 caltinay 3691
824 caltinay 3711 void RipleyDomain::interpolateNodesOnFaces(escript::Data& out, escript::Data& in, bool reduced) const
825 caltinay 3701 {
826     throw RipleyException("interpolateNodesOnFaces() not implemented");
827     }
828    
829    
830 caltinay 3670 } // end of namespace ripley
831    

  ViewVC Help
Powered by ViewVC 1.1.26