#include "Interpolation.hxx"
#include "NormalizedUnstructuredMesh.hxx"
-
+#include "IntersectorHexa.hxx"
+#include "OptionManager.hxx"
namespace INTERP_KERNEL
{
- class Interpolation3D : public Interpolation<Interpolation3D>
+ class Interpolation3D : public Interpolation<Interpolation3D>,OptionManager
{
public:
Interpolation3D();
template<class MatrixType, class MyMeshType>
void interpolateMeshes(const MyMeshType& srcMesh, const MyMeshType& targetMesh, MatrixType& result);
+ private:
+ SplittingPolicy _splitting_policy;
};
}
#include "IntersectorTetra.txx"
#include "IntersectorHexa.txx"
#include "Log.hxx"
-
+#include "OptionManager.hxx"
/// If defined, use recursion to traverse the binary search tree, else use the BBTree class
#define USE_RECURSIVE_BBOX_FILTER
*/
Interpolation3D::Interpolation3D()
{
+ registerOption(&_splitting_policy,"SplittingPolicy",GENERAL_48);
}
/**
break;
case 8:
- intersector = new IntersectorHexa<MyMeshType>(srcMesh, targetMesh, targetIdx);
+
+ SplittingPolicy sp;
+ getOption("SplittingPolicy",sp);
+ intersector = new IntersectorHexa<MyMeshType>(srcMesh, targetMesh, targetIdx,sp);
break;
default:
#define __INTERPOLATION3DSURF_HXX__
#include "InterpolationPlanar.hxx"
-
+#include "OptionManager.hxx"
namespace INTERP_KERNEL
{
class Interpolation3DSurf : public InterpolationPlanar<Interpolation3DSurf>
,_medianPlane(DFT_MEDIAN_PLANE)
,_surf3DAdjustmentEps(DFT_SURF3D_ADJ_EPS)
{
+ registerOption(&_medianPlane,"MedianPlane",DFT_MEDIAN_PLANE);
+ registerOption(&_doRotate,"DoRotate",true);
+ registerOption(&_surf3DAdjustmentEps,"BoundingBoxAdjustment",DFT_SURF3D_ADJ_EPS);
}
/**
#include "Interpolation.hxx"
#include "PlanarIntersector.hxx"
#include "NormalizedUnstructuredMesh.hxx"
+#include "OptionManager.hxx"
namespace INTERP_KERNEL
{
typedef enum {Triangulation, Convex, Geometric2D, Generic} IntersectionType;
template<class RealPlanar>
- class InterpolationPlanar : public Interpolation< InterpolationPlanar<RealPlanar> >
+ class InterpolationPlanar : public Interpolation< InterpolationPlanar<RealPlanar> >, public OptionManager
{
private:
int _printLevel;
#include "ConvexIntersector.txx"
#include "Geometric2DIntersector.hxx"
#include "Geometric2DIntersector.txx"
-//#include "GenericIntersector.hxx"
-//#include "GenericIntersector.cxx"
#include "VectorUtils.hxx"
#include "BBTree.txx"
#include<time.h>
InterpolationPlanar<RealPlanar>::InterpolationPlanar():_printLevel(0),_precision(DEFAULT_PRECISION),_dimCaracteristic(1),
_intersectionType(Triangulation)
{
+ registerOption(&_precision, "Precision",DEFAULT_PRECISION);
+ registerOption(&_intersectionType, "IntersectionType",Triangulation);
+ registerOption(&_printLevel, "PrintLevel",0);
}
/**
#include "TargetIntersector.hxx"
#include "IntersectorTetra.hxx"
#include "NormalizedUnstructuredMesh.hxx"
-
+#include "OptionManager.hxx"
namespace INTERP_KERNEL
{
+
+ /// Type describing the different ways in which the hexahedron can be split into tetrahedra.
+ /// The PLANAR_* policies persume that each face is to be considered planar, while the general
+ /// policies make no such hypothesis. The integer at the end gives the number of tetrahedra
+ /// that result from the split.
+ enum SplittingPolicy { PLANAR_FACE_5 = 5, PLANAR_FACE_6 = 6, GENERAL_24 = 24, GENERAL_48 = 48 };
+
/**
* \brief Class responsible for calculating intersection between a hexahedron target element and
* the source elements.
*
*/
template<class MyMeshType>
- class IntersectorHexa : public TargetIntersector<typename MyMeshType::MyConnType>
+ class IntersectorHexa : public TargetIntersector<typename MyMeshType::MyConnType>, public OptionManager
{
public:
- /// Type describing the different ways in which the hexahedron can be split into tetrahedra.
- /// The PLANAR_* policies persume that each face is to be considered planar, while the general
- /// policies make no such hypothesis. The integer at the end gives the number of tetrahedra
- /// that result from the split.
- enum SplittingPolicy { PLANAR_FACE_5 = 5, PLANAR_FACE_6 = 6, GENERAL_24 = 24, GENERAL_48 = 48 };
+
IntersectorHexa(const MyMeshType& srcMesh, const MyMeshType& targetMesh,
typename MyMeshType::MyConnType targetCell, SplittingPolicy policy = GENERAL_24);
* <TR><TD>ForcedRenormalization</TD><TD>After receiving data, the target field is renormalized so that L2-norms of the source and target fields match.</TD><TD> false </TD></TR>
*</TABLE>
+
+The following code excerpt shows how to set options for an object that inherits from DEC :
+
+\code
+ IntersectionDEC dec(local_group,distant_group);
+ dec.setOptions("ForcedRenormalization",true);
+ dec.attachLocalField(field);
+ dec.synchronize();
+ if (local_group.containsMyRank())
+ dec.sendData();
+ else
+ dec.recvData();
+\endcode
*/
namespace ParaMEDMEM
#ifndef DEC_HXX_
#define DEC_HXX_
-#include "MEDMEM_OptionManager.hxx"
+#include "OptionManager.hxx"
#include <MEDMEM_Field.hxx>
#include <NormalizedUnstructuredMesh.hxx>
class ProcessorGroup;
class ParaFIELD;
class CommInterface;
- class DEC : public MEDMEM::OptionManager
+ class DEC : public INTERP_KERNEL::OptionManager
{
public:
DEC():_local_field(0),_forced_renormalization_flag(false){}
#include <vector>
#include <set>
-#include "MEDMEM_OptionManager.hxx"
+#include "OptionManager.hxx"
namespace MEDMEM
{
class InterpolationMatrix;
- class ElementLocator: public MEDMEM::OptionManager
+ class ElementLocator: public INTERP_KERNEL::OptionManager
{
public:
ElementLocator(const ParaMESH& mesh, const ProcessorGroup& distant_group);
const ParaMEDMEM::ParaMESH& source_support,
const ProcessorGroup& source_group,
const ProcessorGroup& target_group,
-const string& method):
+const OptionManager& option_manager):
+ OptionManager(option_manager),
_source_support(*source_support.getMesh()),
_mapping(source_group, target_group),
- _method(method),
_source_group(source_group),
_target_group(target_group),
_source_volume(0)
MEDNormalizedUnstructuredMesh<3,2>target_wrapper(&distant_support);
MEDNormalizedUnstructuredMesh<3,2> source_wrapper(&_source_support);
INTERP_KERNEL::Interpolation3DSurf interpolator;
+ double precision, median_plane;
+ int print_level;
+ INTERP_KERNEL::IntersectionType inter_type;
+ bool do_rotate;
+ getOption("DoRotate",do_rotate);
+ getOption("Precision",precision);
+ getOption("MedianPlane",median_plane);
+ getOption("PrintLevel",print_level);
+ getOption("IntersectionType",inter_type);
+ interpolator.setOptions(precision,print_level,median_plane,inter_type,do_rotate);
interpolator.interpolateMeshes(target_wrapper,source_wrapper,surfaces);
}
else if (distant_support.getMeshDimension()==2 && distant_support.getSpaceDimension()==2)
#include "MEDMEM_Field.hxx"
#include "MPI_AccessDEC.hxx"
#include "MxN_Mapping.hxx"
-
+#include "OptionManager.hxx"
namespace ParaMEDMEM
{
- class InterpolationMatrix
+ class InterpolationMatrix : public INTERP_KERNEL::OptionManager
{
public:
InterpolationMatrix(const ParaMEDMEM::ParaMESH& source_support,
const ProcessorGroup& local_group,
const ProcessorGroup& distant_group,
- const string& method);
+ const INTERP_KERNEL::OptionManager& option_manager);
virtual ~InterpolationMatrix();
void addContribution(MEDMEM::MESH& distant_support, int iproc_distant, int* distant_elems);
#include "MPIProcessorGroup.hxx"
#include "ParaMESH.hxx"
#include "ParaSUPPORT.hxx"
-#include "MEDMEM_OptionManager.hxx"
+#include "OptionManager.hxx"
#include "DEC.hxx"
#include "InterpolationMatrix.hxx"
#include "IntersectionDEC.hxx"
#include "ElementLocator.hxx"
-#include "MEDMEM_OptionManager.hxx"
+#include "OptionManager.hxx"
namespace ParaMEDMEM
-/* \section intersectiondec_options Options
- * On top of \ref dec_options, options supported by IntersectionDEC objects are
- *
- * <TABLE BORDER=1 >
- * <TR><TD>Option</TD><TD>Description</TD><TD>Default value</TD></TR>
- * <TR><TD>BoundingBoxAdjustment</TD><TD>When detecting an intersection between bounding boxes, the bounding are expanded by a factor (1+BoundingBoxAdjustment). It is particularly useful when detecting intersections for 3D surfaces for which the bounding boxes might not actually intersect.</TD><TD> 0.1 </TD></TR>
- <TR><TD>Method</TD><TD>Specifies the field representation used for the remapping.</TD><TD>P0</TD></TR>
- *</TABLE>
-
+ \section intersectiondec_options Options
+ On top of \ref dec_options, options supported by %IntersectionDEC objects are
+ related to the underlying Intersector class.
+ All the options available in the intersector objects are
+ available for the %IntersectionDEC object. The various options available for * intersectors can be reviewed in \ref InterpKerIntersectors.
+
+ For instance :
+ \verbatim
+ IntersectionDEC dec(source_group, target_group);
+ dec.attachLocalField(field);
+ dec.setOptions("DoRotate",false);
+ dec.setOptions("Precision",1e-12);
+ dec.synchronize();
+ \endverbatim
+
+ \warning{ Options must be set before calling the synchronize method. }
*/
+
/*!
\addtogroup intersectiondec
@{
{
registerOption(&_method,string("Method"),string("P0"));
registerOption(&_bb_adjustment, "BoundingBoxAdjustment",0.1);
+ registerOption(&_intersection_type, "IntersectionType",INTERP_KERNEL::Triangulation);
+ registerOption(&_precision, "Precision", 1e-12);
+ registerOption(&_median_plane, "MedianPlane",0.5);
+ registerOption(&_do_rotate, "DoRotate",true);
registerOption(&_asynchronous, "Asynchronous",false);
+ registerOption(&_splitting_policy, "SplittingPolicy",INTERP_KERNEL::GENERAL_48);
+ registerOption(&_print_level,"PrintLevel",0);
registerOption(&_timeinterpolationmethod,"TimeInterpolation",WithoutTimeInterp);
registerOption(&_allToAllMethod,"AllToAllMethod",Native);
}
{
const ParaMEDMEM::ParaMESH* para_mesh = _local_field->getSupport()->getMesh();
//cout <<"size of Interpolation Matrix"<<sizeof(InterpolationMatrix)<<endl;
- _interpolation_matrix = new InterpolationMatrix (*para_mesh, *_source_group,*_target_group,"P0");
+ _interpolation_matrix = new InterpolationMatrix (*para_mesh, *_source_group,*_target_group,*this);
_interpolation_matrix->setAllToAllMethod(_allToAllMethod);
_interpolation_matrix->getAccessDEC()->Asynchronous( _asynchronous ) ;
_interpolation_matrix->getAccessDEC()->SetTimeInterpolator( _timeinterpolationmethod ) ;
ElementLocator locator(*para_mesh, *_source_group);
//transfering option from IntersectionDEC to ElementLocator
double bb_adj;
- MEDMEM::OptionManager::getOption("BoundingBoxAdjustment",bb_adj);
+ INTERP_KERNEL::OptionManager::getOption("BoundingBoxAdjustment",bb_adj);
locator.setOption("BoundingBoxAdjustment",bb_adj);
MESH* distant_mesh=0;
#ifndef INTERSECTIONDEC_HXX_
#define INTERSECTIONDEC_HXX_
-#include "MEDMEM_OptionManager.hxx"
+#include "DEC.hxx"
#include "MPI_AccessDEC.hxx"
#include "MxN_Mapping.hxx"
+#include "InterpolationPlanar.hxx"
+#include "IntersectorHexa.hxx"
+
namespace ParaMEDMEM
{
- class DEC;
class InterpolationMatrix;
class IntersectionDEC:public DEC
InterpolationMatrix* _interpolation_matrix;
+ //options
double _bb_adjustment;
-
bool _asynchronous;
TimeInterpolationMethod _timeinterpolationmethod ;
AllToAllMethod _allToAllMethod;
+ INTERP_KERNEL::IntersectionType _intersection_type;
+ double _precision;
+ double _median_plane;
+ bool _do_rotate;
+ INTERP_KERNEL::SplittingPolicy _splitting_policy;
+ int _print_level;
+
+
};
}