source: XIOS/trunk/src/node/compute_connectivity_domain.cpp @ 2280

Last change on this file since 2280 was 1852, checked in by ymipsl, 5 years ago

Compiler fix : solve the problem of crash occured with recent version of GCC, only in optimised mode > O1
It seems to be due to non return value from a non void function in case of early initialization (static initialization).
Thanks to A. Durocher who find the tip.

YM

File size: 2.4 KB
Line 
1#include "compute_connectivity_domain.hpp"
2#include "type.hpp"
3
4namespace xios {
5
6  /// ////////////////////// Définitions ////////////////////// ///
7
8  CComputeConnectivityDomain::CComputeConnectivityDomain(void)
9    : CObjectTemplate<CComputeConnectivityDomain>(), CComputeConnectivityDomainAttributes(), CTransformation<CDomain>()
10  { /* Ne rien faire de plus */ }
11
12  CComputeConnectivityDomain::CComputeConnectivityDomain(const StdString & id)
13    : CObjectTemplate<CComputeConnectivityDomain>(id), CComputeConnectivityDomainAttributes(), CTransformation<CDomain>()
14  { /* Ne rien faire de plus */ }
15
16  CComputeConnectivityDomain::~CComputeConnectivityDomain(void)
17  {}
18
19  CTransformation<CDomain>* CComputeConnectivityDomain::create(const StdString& id, xml::CXMLNode* node)
20  {
21    CComputeConnectivityDomain* compute_connectivityDomain = CComputeConnectivityDomainGroup::get("compute_connectivity_domain_definition")->createChild(id);
22    if (node) compute_connectivityDomain->parse(*node);
23    return static_cast<CTransformation<CDomain>*>(compute_connectivityDomain);
24  }
25
26  bool CComputeConnectivityDomain::_dummyRegistered = CComputeConnectivityDomain::registerTrans();
27  bool CComputeConnectivityDomain::registerTrans()
28  {
29    return registerTransformation(TRANS_COMPUTE_CONNECTIVITY_DOMAIN, CComputeConnectivityDomain::create);
30  }
31
32  //----------------------------------------------------------------
33
34  StdString CComputeConnectivityDomain::GetName(void)    { return StdString("compute_connectivity_domain"); }
35  StdString CComputeConnectivityDomain::GetDefName(void) { return StdString("compute_connectivity_domain"); }
36  ENodeType CComputeConnectivityDomain::GetType(void)    { return eComputeConnectivityDomain; }
37
38  void CComputeConnectivityDomain::checkValid(CDomain* domainDst)
39  {
40    if (CDomain::type_attr::unstructured != domainDst->type)
41    {
42      ERROR("CComputeConnectivityDomain::checkValid(CDomain* domainDst)",
43            << "Domain connectivity computation is only supported for unstructured" << std::endl
44            << "Check type of domain destination, id = " << domainDst->getId());
45    }
46
47    if (type.isEmpty()) type.setValue(CComputeConnectivityDomain::type_attr::edge);
48    if (n_neighbor_max.isEmpty()) n_neighbor_max.setValue(0);
49    if (n_neighbor.isEmpty()) n_neighbor.resize(domainDst->i_index.numElements());
50    if (local_neighbor.isEmpty()) local_neighbor.resize(1,1);
51  }
52
53}
Note: See TracBrowser for help on using the repository browser.