1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef __PARAMEDMEMCOMPOCOMPONENT_I__
21 #define __PARAMEDMEMCOMPOCOMPONENT_I__
23 #include "SALOMEconfig.h"
24 #include CORBA_SERVER_HEADER(ParaMEDMEMComponent)
25 #include "MPIObject_i.hxx"
26 #include "SALOME_Component_i.hxx"
27 #include "Topology.hxx"
28 #include "MEDCouplingFieldDouble.hxx"
29 #include "InterpKernelDEC.hxx"
30 #include "InterpolationOptions.hxx"
31 #include "MPIProcessorGroup.hxx"
32 #include "CommInterface.hxx"
33 #include "MEDCouplingFieldDoubleServant.hxx"
34 #include "Utils_CorbaException.hxx"
37 void * th_setinterpolationoptions(void *st);
38 void * th_initializecoupling(void *st);
39 void * th_terminatecoupling(void *st);
40 void * th_getdata(void *st);
41 void * th_initializecouplingdist (void *st);
42 void * th_terminatecouplingdist (void *st);
48 const char * intersection_type;
52 double bounding_box_adjustment;
53 double bounding_box_adjustment_abs;
54 double max_distance_for_3Dsurf_intersect;
57 const char * splitting_policy;
58 bool P1P0_bary_method;
61 Engines::IORTab* tior;
62 SALOME_MED::MPIMEDCouplingFieldDoubleCorbaInterface_ptr fieldptr;
63 SALOME_MED::ParaMEDMEMComponent_ptr compo;
68 class ParaMEDMEMComponent_i : public virtual POA_SALOME_MED::ParaMEDMEMComponent, public Engines_Component_i, public MPIObject_i
73 ParaMEDMEMComponent_i();
74 ParaMEDMEMComponent_i(CORBA::ORB_ptr orb,
75 PortableServer::POA_ptr poa,
76 PortableServer::ObjectId * contId,
77 const char *instanceName,
78 const char *interfaceName,
82 virtual ~ParaMEDMEMComponent_i();
83 void setInterpolationOptions(const char * coupling,
84 CORBA::Long print_level,
85 const char * intersection_type,
86 CORBA::Double precision,
87 CORBA::Double median_plane,
88 CORBA::Boolean do_rotate,
89 CORBA::Double bounding_box_adjustment,
90 CORBA::Double bounding_box_adjustment_abs,
91 CORBA::Double max_distance_for_3Dsurf_intersect,
92 CORBA::Long orientation,
93 CORBA::Boolean measure_abs,
94 const char * splitting_policy,
95 CORBA::Boolean P1P0_bary_method ) throw(SALOME::SALOME_Exception);
96 virtual void initializeCoupling(const char * coupling, const char * ior) throw(SALOME::SALOME_Exception);
97 virtual void terminateCoupling(const char * coupling) throw(SALOME::SALOME_Exception);
98 virtual void _getOutputField(const char * coupling, MEDCouplingFieldDouble* field);
101 void _initializeCoupling(SALOME_MED::MPIMEDCouplingFieldDoubleCorbaInterface_ptr fieldptr);
102 void _setInputField(SALOME_MED::MPIMEDCouplingFieldDoubleCorbaInterface_ptr fieldptr, MEDCouplingFieldDouble* field);
103 bool amICoupledWithThisComponent(const char * cref);
106 std::map<std::string,std::string>::const_iterator mapSearchByValue(std::map<std::string,std::string> & search_map, std::string search_val);
108 CommInterface* _interface;
109 std::map<std::string,InterpKernelDEC*> _dec;
110 std::map<std::string,MPIProcessorGroup*> _source, _target;
111 std::map<std::string,ProcessorGroup*> _commgroup;
112 std::map<std::string,INTERP_KERNEL::InterpolationOptions*> _dec_options;
113 std::map<std::string,std::string> _connectto; //IOR of distant objects